急:无法创建下列URL的连接: jdbc:jtds:sqlserver://localhost:1433/hrms
driver=net.sourceforge.jtds.jdbc.Driversqlserver.url=jdbc:jtds:sqlserver://localhost:...
driver=net.sourceforge.jtds.jdbc.Driversqlserver.url=jdbc:jtds:sqlserver://localhost:1433/hrmssqlserver.user=kingsqlserver.password=123sqlserver.maxconn=2000上面是配置文件内容 数据库的用户名和密码都没错并且数据库的SQL Server (MSSQLSERVER)SQL Server (SQLEXPRESS)SQL Server Agent (MSSQLSERVER)等等能开的服务都开了当登录输入了正确的用户名和密码时,提示用户名错误。控制台输出如下Username;adminCOUNT-----------------;Wed Jun 30 20:57:20 CST 2010: 成功注册JDBC驱动程序net.sourceforge.jtds.jdbc.Driverusername:king;password:123Wed Jun 30 20:57:20 CST 2010: 成功创建连接池sqlserver----------user---------------:kingWed Jun 30 20:57:22 CST 2010: 无法创建下列URL的连接: jdbc:jtds:sqlserver://localhost:1433/hrmsjava.lang.NullPointerExceptionjava.lang.NullPointerException
展开
2个回答
展开全部
private static final String DBDRIVER="com.microsoft.sqlserver.jdbc.SQLServerDriver";
private static final String DBNAME="sa";
private static final String DBPASS="sa";
private static final String DBURL="jdbc:sqlserver://localhost:1433;databasename=demo";
Class.forName(DBDRIVER);
conn=DriverManager.getConnection(DBURL,DBNAME,DBPASS);
private static final String DBNAME="sa";
private static final String DBPASS="sa";
private static final String DBURL="jdbc:sqlserver://localhost:1433;databasename=demo";
Class.forName(DBDRIVER);
conn=DriverManager.getConnection(DBURL,DBNAME,DBPASS);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询