File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "SQLException:  invalid arguments in call??" Watch "SQLException:  invalid arguments in call??" New topic

SQLException: invalid arguments in call??

carl varola
Ranch Hand

Joined: May 16, 2002
Posts: 59
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.
java.sql.SQLException: invalid arguments in call
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.throwSqlException(
at oracle.jdbc.dbaccess.DBError.check_error(
at oracle.jdbc.ttc7.TTC7Protocol.logon(
at oracle.jdbc.driver.OracleConnection.<init>(
at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.ja
at oracle.jdbc.driver.OracleDriver.connect(
at java.sql.DriverManager.getConnection(
at java.sql.DriverManager.getConnection(
at attemptConnection.main(
import java.sql.*;
import java.util.*;
public class attemptConnection
public static void main(String arg[])
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
//Here how do i specify the subname to locate my database
con = DriverManager.getConnection("jdbc: oracle:thin:@ : ORCL");
//con = DriverManager.getConnection("jdbc: odbc:uae", "scott", "tiger");
stmt = con.createStatement();
String sqlStatement="SELECT * FROM customers";
rs = stmt.executeQuery(sqlStatement);
catch(ClassNotFoundException e)
System.out.println("Couldn't load database driver: " + e.getMessage());
catch(SQLException e)
//System.out.println("SQLException caught: " + e.getMessage());
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 ]
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().
I agree. Here's the link:
subject: SQLException: invalid arguments in call??
It's not a secret anymore!