Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Unable to Run Database App(Error: 998 is not a valid line number in com.mysql.jdbc.SQLError)
Unable to Run Database App [message #1700760] Mon, 06 July 2015 16:20
Eclipse UserFriend
I'm in the process of teaching myself how to write data driven apps in Java, but I've run into a bit of a snag. When I try to run my code, I get the following error:

"998 is not a valid line number in com.mysql.jdbc.SQLError"

The following is the code I wrote:

package net.xtraordinayr.mysqldemo;

import java.sql.*;

public class DemoDriver {

	public static void main(String[] args) {
		try{
			// Load the driver
			Class.forName("com.mysql.jdbc.Driver");
			
			// 1. Get a connection to the database
			Connection mySqlConn = 
					DriverManager.getConnection("jdbc:mysql://localhost:3306/starfleetacademydb", "root", "ncc_1701-f");
			
			// 2. Create a statement
			Statement demoQuery = mySqlConn.createStatement();
			
			// 3. Execute SQL query
			ResultSet mySqlRs = demoQuery.executeQuery("SELECT * FROM student_table");
			
			// 4. Process the result set
			System.out.println(mySqlRs.getString("rankID") + " " +
					mySqlRs.getString("lastName") + " " +
					mySqlRs.getString("firstName"));
		}
		catch(Exception ex){
			ex.printStackTrace();
		}

	}

}


Is there any way to get past this issue so that I can determine if my code is working?

TekknoDraykko
Previous Topic:[Eclipse Juno] Problem with set up of JDK8
Next Topic:Wrong IJavaProject returned
Goto Forum:
  


Current Time: Mon May 12 05:48:18 EDT 2025

Powered by FUDForum. Page generated in 0.05361 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top