Results 1 to 2 of 2
Thread: Jdbc connection mssql empty URL
- 02-17-2013, 11:08 AM #1
Member
- Join Date
- Feb 2013
- Posts
- 1
- Rep Power
- 0
Jdbc connection mssql empty URL
Hello i've got this code:
which links to:Java Code:DatabaseManager.init("com.inet.tds.TdsDriver", "jdbc:inetdae:127.0.0.1?database=main", "username", "password", 10);
But gives me this fault:Java Code:public static void init(String JDBCDriver, String parURL, String parUserName, String parPassWord, int maxConnections) throws ClassNotFoundException, SQLException { Class.forName(JDBCDriver); URL = parURL; userName = parUserName; passWord = parPassWord; openConnection(); }
By this script:Java Code:DatabaseManager.getConnection() : java.sql.SQLException: The url cannot be null
Does anyone have a clue why it tells me the url is empty?Java Code:public static void openConnection() throws SQLException{ connection = DriverManager.getConnection(URL, userName, passWord); } public static Connection getConnection() { try { if (connection!=null) { if (connection.isClosed()) openConnection(); } else { openConnection(); } } catch (SQLException e) { System.out.println("deze fout: DatabaseManager.getConnection() : " + e); return null; } return connection;
Please let me know if you need to see more scripting
- 02-18-2013, 11:04 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,484
- Rep Power
- 16
Similar Threads
-
JDBC connection
By Dineshmtech in forum JDBCReplies: 2Last Post: 01-07-2012, 08:20 AM -
JDBC Connection
By Riyaz.hk77 in forum New To JavaReplies: 2Last Post: 11-06-2010, 05:53 PM -
java connection to mssql
By gerard kowara in forum JDBCReplies: 9Last Post: 10-14-2010, 09:07 AM -
JDBC connection
By evermore in forum JDBCReplies: 1Last Post: 03-19-2010, 08:35 AM -
JDBC connection
By Java Tip in forum Java TipReplies: 0Last Post: 11-10-2007, 07:39 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks