No Data Found Error In Java
Contents |
here for a quick overview of the java no data found exception site Help Center Detailed answers to any questions you java.sql.sqlexception no data found ms access might have Meta Discuss the workings and policies of this site About Us Learn how to catch no data found exception in java more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Exception Java.sql.sqlexception No Data Found
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up No data found Java exception up vote 1 down vote exception in thread main java.sql.sqlexception no data found favorite I'm new to Java and working on a project. i am trying to retrieve data from MS Access with the use of Netbeans. It was all working fine untill i reinstalled my operating system. Now wen i run the code I get this error. Your help and advice would be much appreciated java.sql.SQLException: No data found at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7138) at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073) at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323) at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174) at java.sql.DriverManager.getConnection(DriverManager.java:582) at java.sql.DriverManager.getConnection(DriverManager.java:185) at connect.ConnectDB(connect.java:24) at StaffLogin.formWindowOpened(StaffLogin.java:125) at StaffLogin.access$000(StaffLogin.java:13) at StaffLogin$1.windowOpened(StaffLogin.java:47) at java.awt.Window.processWindowEvent(Window.java:1859) at javax.swing.JFrame.processWindowEvent(JFrame.java:279) at java.awt.Window.processEvent(Window.java:1820) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Window.dispatchEventImpl(Window.java:2475) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122) This is the code, I have left out the 'generated code' and the 'look and feel' also. please let me know if these are needed. Thanks. import java.sql.*; import javax.sw
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the http://stackoverflow.com/questions/10197733/no-data-found-java-exception Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Getting SEVERE: null java.sql.SQLException: No data found error up vote 0 down vote favorite I am trying to store the DB value http://stackoverflow.com/questions/30022058/getting-severe-null-java-sql-sqlexception-no-data-found-error into two different array. if test_type is ”New”=> store first array, else=> second array. Am getting “SEVERE: null java.sql.SQLException: No data found error” while assign rs.getString value to variable\array. Could anyone help me to solve the issue? Am using MS access as DB code: try { DatabaseConnectivity(); stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY); String select="Select * from (SELECT DISTINCT test_name,test_type FROM ScenarioTable)order by test_type "; ResultSet rs = stmt.executeQuery(select); String colvalues; String print="null"; int arycount=1; basicarray=new String [20][20]; newarray=new String [20][20]; while (rs.next()) { print=rs.getString(1); if (print.equals("New")) { for(int itration=1;itration<=2;itration++) { colvalues=rs.getString(itration); newarray[arycount][itration]=colvalues; } } else { for(int itration=1;itration<=2;itration++) { colvalues=rs.getString(itration); basicarray[arycount][itration]=colvalues; } arycount++; } error: Connection Successful May 04, 2015 8:26:37 AM NewJFrame btn_refreshActionPerformed SEVERE: null java.sql.SQLException: No data found at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7145) at sun.jdbc.odbc.JdbcOdbc.SQLGetDataString(JdbcOdbc.java:3914) at sun.jdbc.odbc.JdbcOdbcResultSet.getDataString(JdbcOdbcResultSet.java:5697) at sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:353) at NewJFrame.btn_refreshActionPerformed(NewJFrame.java:1140) at NewJFrame.access$1800(NewJFrame.java:47) at NewJFrame$21.actionPerformed(NewJFrame.java:734) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) java sql sqlexception share|improve this question edited May 4 '15 at 3:15
details. Win a copy of Penetration Testing Basics this week in the Security forum! Post Reply Bookmark Topic Watch Topic New Topic programming https://coderanch.com/t/304295/JDBC/databases/ERROR-java-sql-SQLException-data forums Java Java JSRs Mobile Certification Databases Caching Books Engineering Languages Frameworks Products This Site Careers Other all forums Forum: JDBC and Relational Databases ERROR: java.sql.SQLException: No data found rakshini nithya Ranch Hand Posts: 39 posted 10 years ago hi am trying to create a table in ms-access but am getting this error while running the no data code i have created the datasource name (userloginTable) and created a driver (microsoft access driver(*.mdb)) can You please help me in this problem Here is my code /* * Created on Jul 10, 2006 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - no data found Code Templates */ package com.cts.dbconn; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; /** * @author 133474 * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class DBconn { public static void main(String args[]) { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String dataSourceName ="userlogintable"; String dbURL = "jdbcdbc:" + dataSourceName; Connection con = DriverManager.getConnection(dbURL, "",""); Statement s = con.createStatement(); s.execute("create table TEST(username integer,password char[6])"); s.execute("insert into TEST values(133484,'abc')"); s.execute("insert into TEST values(133474,'def')"); s.execute("insert into TEST values(133484,'ghi')"); s.execute("select username,password from TEST"); ResultSet rs = s.getResultSet(); if (rs != null) while ( rs.next() ) { System.out.println("Data from username: " + rs.getString(1) ); System.out.println("Data from password: " + rs.getString(2) ); } s.close(); con.close(); } catch (Exception err) { System.out.println("ERROR: " + err); } } } Ash Kondhalkar Ranch Hand Posts: 43 posted 10 years ago I think the create statement needs to be changed to as below, "create table TEST(username integer,password text)" and it wil