aspose file tools*
The moose likes Tomcat and the fly likes SQLException:  invalid arguments in call?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "SQLException:  invalid arguments in call??" Watch "SQLException:  invalid arguments in call??" New topic
Author

SQLException: invalid arguments in call??

carl varola
Ranch Hand

Joined: May 16, 2002
Posts: 59
Hi
I'm having the following error,also i included the sample code to access my local oracle database.
i have oracle on my c:\ drive.
Thanks for the help.
error:
=======================================
java.sql.SQLException: invalid arguments in call
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:803)
at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:175)
at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:198)
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
va:251)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:224)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:194)
at attemptConnection.main(attemptConnection.java:16)
==================================
code:
===============================
import java.sql.*;
import java.util.*;
public class attemptConnection
{
public static void main(String arg[])
{
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
//Here how do i specify the subname to locate my database
con = DriverManager.getConnection("jdbc: oracle:thin:@ 171.164.139.78:1521 : ORCL");
//con = DriverManager.getConnection("jdbc: odbc:uae", "scott", "tiger");
stmt = con.createStatement();
String sqlStatement="SELECT * FROM customers";
rs = stmt.executeQuery(sqlStatement);
while(rs.next())
{
System.out.println(rs.getString("last"));
}
}
catch(ClassNotFoundException e)
{
System.out.println("Couldn't load database driver: " + e.getMessage());
}
catch(SQLException e)
{
//System.out.println("SQLException caught: " + e.getMessage());
e.printStackTrace();
}
finally
{
try
{
if(con != null) con.close();
}
catch(SQLException ignored){}
}
}
}
[Bodie Minster - Removed the smiley's from the JDBC stuff]
[ May 17, 2002: Message edited by: Bodie Minster ]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Two things:
1) This question is probably better suited to the JDBC forum. I'll transfer it there.
2) It's tough to tell because you have to include spaces to avoid the smileys, but I don't think you want any spaces in the string you are passing to getConnection().
 
 
subject: SQLException: invalid arguments in call??