orhan yazdi | jtds kullanıyor isen.
Class.forName("net.sourceforge.jtds.jdbc.Driver") |
Driver sorununu aştım sanırım ama yinede hata var.
SQL Server üzerinde ayarlarla oynamam lazımmı bilmiyorum. İlk defa kullanıyorum sql server
Connection conn = null;
try
{
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
conn= DriverManager.getConnection("jdbc:sqlserver://localhost:1433/HR_Dbase","Burak AMASYALI","****");
System.out.println("connected");
}
catch (Exception e)
{
e.printStackTrace();
}
com.microsoft.sqlserver.jdbc.SQLServerException: The port number 1433/HR_Dbase is not valid.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at sqlserverconnection.Main.main(Main.java:29)
java.lang.NullPointerException
at sqlserverconnection.Main.main(Main.java:40)
The Man Who Loved Algorithm&Ubuntu.
www.burakamasyali.com
|