dcsimg
Strange question!!
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jjfat_jjfat
Posted On:   Friday, October 26, 2001 01:42 AM

when i run it , it return this: D:javapp>java data Exception in thread "main" java.lang.NullPointerException at com.codestudio.sql.PoolManResultSet.clearUpdates(Unknown Source) at com.codestudio.sql.PoolManResultSet.next(Unknown Source) at data.main(data.java:52) here is the Source code: import com.codestudio.sql.PoolMan; import com.codestudio.util.SQLResult; import com.codestudio.util.SQLUtil; import javax.sql.DataSource; import java.sql.*; import java.util.Enumeration; import java.util.Hashtable; class data { public data() {} ResultSet res=null;    More>>
when i run it , it return this:

			
D:javapp>java data
Exception in thread "main" java.lang.NullPointerException
at com.codestudio.sql.PoolManResultSet.clearUpdates(Unknown Source)
at com.codestudio.sql.PoolManResultSet.next(Unknown Source)
at data.main(data.java:52)



here is the Source code:


			

import com.codestudio.sql.PoolMan;
import com.codestudio.util.SQLResult;
import com.codestudio.util.SQLUtil;

import javax.sql.DataSource;
import java.sql.*;
import java.util.Enumeration;
import java.util.Hashtable;

class data
{
public data()
{}
ResultSet res=null;
public ResultSet conn()
{
try {
// load the PoolMan JDBC Driver
Class.forName("com.codestudio.sql.PoolMan").newInstance();
} catch (Exception ex) {
System.out.println("Could Not Find the PoolMan Driver,Is poolman.jar in your CLASSPATH?");
}

Connection con = null;
try {

// establish a Connection to the database with
// testdb
//in the poolman.xml file
con = DriverManager.getConnection("jdbc:poolman://oradb_192.168.4.10");

// Use the Connection to create Statements and do JDBC work
Statement stm = con.createStatement();
// ... etc. ...
String sql="select * from table_account";

res = stm.executeQuery(sql);


} catch (SQLException sqle) { sqle.printStackTrace(); }
finally {
try { con.close(); } catch (SQLException csqle) {}
}
return res;
}

public static void main(String[] args)
{
data jj=new data();
try{
ResultSet rs=jj.conn();
rs.next();
}
catch(SQLException e)
{}
}
}

   <<Less
About | Sitemap | Contact