| | |
problem in accessin table values from access database..
![]() |
Hi all..
I am having a table named "login" in MS access..
I am connecting it to a java application with th help of the following code..
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("Driver loaded");
// Establish a connection
connection = DriverManager.getConnection("jdbc:odbc:ESMDB");
System.out.println ("Database connected");
String result="";
st = connection.createStatement();
rs = st.executeQuery("SELECT * FROM Login");
while(rs.next())
{
String user= rs.getString(1);
String pw=rs.getString(2);
System.out.println(username+password);
I am getting null value when i try to execute "select * from Login"..
what could be the reason..?Someone help in this regard as early as possible.
Regards,
Balagurunathan S
I am having a table named "login" in MS access..
I am connecting it to a java application with th help of the following code..
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
System.out.println("Driver loaded");
// Establish a connection
connection = DriverManager.getConnection("jdbc:odbc:ESMDB");
System.out.println ("Database connected");
String result="";
st = connection.createStatement();
rs = st.executeQuery("SELECT * FROM Login");
while(rs.next())
{
String user= rs.getString(1);
String pw=rs.getString(2);
System.out.println(username+password);
I am getting null value when i try to execute "select * from Login"..
what could be the reason..?Someone help in this regard as early as possible.
Regards,
Balagurunathan S
what "null value"?
It's highly unlikely the ResultSet will be null, though with that bad driver you're using it could maybe happen (as it was never intended to be more than a technology demonstrator, and possibly poorly written).
The database could contain NULL values for you to retrieve, if so you will indeed get them back.
It's your responsibility to handle those in some way appropriate to the data you're retrieving (maybe you get NULL for a password if it's not been set for example).
It's highly unlikely the ResultSet will be null, though with that bad driver you're using it could maybe happen (as it was never intended to be more than a technology demonstrator, and possibly poorly written).
The database could contain NULL values for you to retrieve, if so you will indeed get them back.
It's your responsibility to handle those in some way appropriate to the data you're retrieving (maybe you get NULL for a password if it's not been set for example).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- Visual C#: Inserting an Access Database Record (C#)
- Running a VB application with MS Access database (Visual Basic 4 / 5 / 6)
- i cant save data on an access database (C#)
- Two Issues With Access Database App (MS Access and FileMaker Pro)
- Inserting a new Access Database Record (VB.NET)
- Pls help me regarding to access database in vb6 (Visual Basic 4 / 5 / 6)
- Saving information from .NET webcontol into access(database) (ASP.NET)
- Registration and Login scripts using VB and Oledbconnection to Access Database (ASP.NET)
- Insert radio button value into MS Access database (ASP)
Other Threads in the Java Forum
- Previous Thread: Please Help me......error in compiling
- Next Thread: How to learn Java
| Thread Tools | Search this Thread |
-xlint add android api applet application applications array arrays automation bank bi binary blackberry bluetooth chat class client code compile compiler component database development digit eclipse equation error event fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide idea image infinite input int integer j2me java javame javaprojects jetbrains jni jpanel jtable julia learningresources linux list login loop main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying pearl problem program programming project qt recursion scanner screen scrollbar server set sms sort sorting spamblocker sql sqlserver string superclass swing system text-file thread threads tree variablebinding windows xor






