db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrunk <jstr...@stny.rr.com>
Subject Re: SQLException: Syntax error: Encountered "<EOF>" at line 1, column 19.
Date Mon, 28 Sep 2009 22:20:29 GMT

At my level, its too hard to understand the demo programs. I did find several
places online that said you DO NOT code the parens on the procedure name if
there are no parameters. So I took that out. Here is my code now and the
error I get now.

import java.sql.*;
     
public class InstallProcs {

     public static void main(String args[]) {
		  
        String url =
"jdbc:derby://localhost:1527/COFFEEBREAK;user=root;password=rootpw";
        Connection con;
        String installJar;
        String createProc;
		
	installJar = "{call sqlj.install_jar(" +
	                 "'file:/C:/Users/jim/DerbyWorkspace/SQLRoutines.jar',
'routines_jar', 0)}"; 
		
	createProc = "create procedure show_suppliers " +
		     "reads sql data " +
	                  "dynamic result sets 1 " +
		     "external name 'routines_jar:SuppliersProcs.showSuppliers' " +
		     "language java parameter style java";
	
	Statement stmt;
	
	try {
		con = DriverManager.getConnection(url);
		stmt = con.createStatement();	
   		stmt.executeUpdate(installJar);
   		stmt.executeUpdate(createProc);
		stmt.close();
		con.close();
		} catch(SQLException ex) {
	  	System.err.println("SQLException: " + ex.getMessage());
		ex.printStackTrace();
	}
     }
}



SQLException: Syntax error: Encountered "reads" at line 1, column 33.
java.sql.SQLSyntaxErrorException: Syntax error: Encountered "reads" at line
1, column 33.
	at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown
Source)
	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
	at org.apache.derby.client.am.Statement.executeUpdate(Unknown Source)
	at InstallProcs.main(InstallProcs.java:35)
Caused by: org.apache.derby.client.am.SqlException: Syntax error:
Encountered "reads" at line 1, column 33.
	at org.apache.derby.client.am.Statement.completeSqlca(Unknown Source)
	at org.apache.derby.client.am.Statement.completeExecuteImmediate(Unknown
Source)
	at
org.apache.derby.client.net.NetStatementReply.parseEXCSQLIMMreply(Unknown
Source)
	at
org.apache.derby.client.net.NetStatementReply.readExecuteImmediate(Unknown
Source)
	at org.apache.derby.client.net.StatementReply.readExecuteImmediate(Unknown
Source)
	at org.apache.derby.client.net.NetStatement.readExecuteImmediate_(Unknown
Source)
	at org.apache.derby.client.am.Statement.readExecuteImmediate(Unknown
Source)
	at org.apache.derby.client.am.Statement.flowExecute(Unknown Source)
	at org.apache.derby.client.am.Statement.executeUpdateX(Unknown Source)
	... 2 more






jstrunk wrote:
> 
> I am using Eclipse 3.5.0 with Derby 10.5.3.0 (not the Derby Plugin). I
> created an SQLJ stored procedure and stored it. When I try to execute it I
> get SQLException: Syntax error: Encountered "<EOF>" at line 1, column 19. 
> 
> That is the only error information I get. How can I get a listing of what
> SQL thinks the procedure looks like up to the point where the error
> occurs?
> 

-- 
View this message in context: http://www.nabble.com/SQLException%3A-Syntax-error%3A-Encountered-%22%3CEOF%3E%22-at-line-1%2C-column-19.-tp25638168p25653968.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.


Mime
View raw message