PDA

View Full Version : null pointer exception


Thimo
10-29-2002, 10:18 AM
<%
// load driver
Class.forName("org.gjt.mm.mysql.Driver");

// pass database parameters to JDBC driver
Connection Con = DriverManager.getConnection("jdbc:mysql://localhost/MovieXpress?user=root&password=root");

// query statement
Statement SQLStatement5 = Con.createStatement();

Statement SQLStatement6 = Con.createStatement();
%>

<%
// select movietitles from cathay
ResultSet rs5 = SQLStatement5.executeQuery("SELECT DISTINCT MovieTitle FROM cathay");

// insert all the movietitles from cathay into a table
while(rs5.next()) {

String cathay_movie = rs5.getString("MovieTitle");

ResultSet rs6 = SQLStatement6.executeQuery("INSERT INTO combine (MovieTitle) VALUES ('"+cathay_movie+"')");

}
%>

hi, wat's the problem wif this code?

the error message that i got is: java.lang.NullPointerException

Spookster
10-29-2002, 02:10 PM
Why do you have two different forum logins?

http://codingforums.com/showthread.php?s=&threadid=8811

Thimo
10-29-2002, 02:19 PM
ohh.... juz using my friends' account.... i myself juz registered today....

i was at his house, so its auto-logined with his username...so i used his account to post...