SQLException: [BEA][SQLServer JDBC Driver][SQLServer]"Error converting data type nvarchar to smalldatetime."
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chuck_Chakrabarti
Posted On:   Tuesday, July 20, 2004 01:44 PM

I have a standalone JDBC client that calls a stored proc. into a SQL server database. The procedure takes in 3 string parameters. The above exception is thrown everytime.I am using Type4 BEA JDBC Driver for MS Sql Server. What is that I am doing wrong. Any help ? public class JDBCTest { public static void main(String args[]) { String url = "jdbc:bea:sqlserver://XXX.XXX.COM:1433;Databasename=P"; Connection con; String createString; createString = "{call p_XXX_TransSym(?,?,?)}"; CallableStatement stmt; try { Class.forName("weblogic.jdbc.sqlserver.SQLServerDriver"); } catch(java.lang.ClassNotFoundException e) { System.err   More>>

I have a standalone JDBC client that calls a stored proc. into a SQL server database. The procedure takes in 3 string parameters. The above exception is thrown everytime.I am using Type4 BEA JDBC Driver for MS Sql Server. What is that I am doing wrong. Any help ?


			
public class JDBCTest {
public static void main(String args[]) {
String url = "jdbc:bea:sqlserver://XXX.XXX.COM:1433;Databasename=P";
Connection con;
String createString;
createString = "{call p_XXX_TransSym(?,?,?)}";
CallableStatement stmt;

try {
Class.forName("weblogic.jdbc.sqlserver.SQLServerDriver");
} catch(java.lang.ClassNotFoundException e) {
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
}

try {
con = DriverManager.getConnection(url, "NewportAdvertise", "NewportAdvertise");
stmt = con.prepareCall(createString);
stmt.setString (1, "49085");
stmt.setString (2, "Y");
stmt.setString (3, "Y");

ResultSet rs = stmt.executeQuery();
while (rs.next()) {
ResultSetMetaData rsMd = rs.getMetaData();
for (int i = 1 ; i < rsMd.getColumnCount(); i++) {
System.out.println ("Data " + rsMd.getColumnLabel(i) + " " + rs.getString(i));
}
}
stmt.close();
con.close();

} catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
ex.printStackTrace();
}
}
}
   <<Less
About | Sitemap | Contact