Results 1 to 4 of 4
Thread: driver problem
- 08-23-2010, 06:15 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 7
- Rep Power
- 0
- 08-23-2010, 06:16 PM #2
Member
- Join Date
- Apr 2010
- Posts
- 7
- Rep Power
- 0
driver problem here goes my code:
import java.sql.*;
class JdbcTest {
public static void main (String args []) throws SQLException {
// Load Oracle driver
Statement stmt=null;
Connection conn=null;
ResultSet rset=null;
try{
Class.forName("oracle.jdbc.driver.OracleDriver");
// Connect to the local database
// conn=DriverManager.getConnection("jdbc:oracle:thin :@localhost:1521:orcl","scott", "tiger");
conn = DriverManager.getConnection("jdbc:oracle:thin:@dss w2k01:1521:orcl","scott", "tiger");
// Query the employee names
stmt = conn.createStatement ();
rset = stmt.executeQuery ("SELECT ename FROM emp");
}
catch(Exception e){
System.out.println(e.getMessage());
}
// Print the name out
while (rset.next ())
System.out.println (rset.getString (2));
//close the result set, statement, and the connection
rset.close();
stmt.close();
conn.close();
}
}
- 08-24-2010, 07:44 AM #3
Member
- Join Date
- Jul 2010
- Posts
- 32
- Rep Power
- 0
The problem is the driver what IDE a you using ?
are these two words "dss w2k01"?
- 08-24-2010, 08:44 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
Problem finding SQLite JDBC driver
By PrinceSendai in forum JDBCReplies: 9Last Post: 08-09-2010, 01:24 AM -
mysql driver problem
By mokingsu in forum JDBCReplies: 4Last Post: 01-17-2008, 05:27 PM -
PostgreSQL driver
By bugger in forum JDBCReplies: 3Last Post: 01-11-2008, 09:45 AM -
JDBC Driver problem
By Swamipsn in forum New To JavaReplies: 3Last Post: 08-09-2007, 03:55 PM -
JDBC driver connection problem
By creativehacker in forum JDBCReplies: 3Last Post: 07-10-2007, 09:58 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks