public static void main(String[] args)
{
/** give some ini number*/
int count=1;
int totalitem=0;
String user="sync4j";
String passwd="sync4j";
String url = "jdbc:microsoft:sqlserver://804-R/LQ:1433";
Connection con=null;
Statement stmt=null;
try {
/**open the test database*/
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
System.out.println("Opening db connection"); con = DriverManager.getConnection(url,user,passwd);
stmt = con.createStatement();
}
catch (ClassNotFoundException ex) {
System.err.println("Cannot find the database driver classes.");
System.err.println(ex);
}
catch (SQLException ex)
{
System.err.println("Cannot connect to this database.");
System.err.println(ex);
}
对着做做,应该没问题的。
{
/** give some ini number*/
int count=1;
int totalitem=0;
String user="sync4j";
String passwd="sync4j";
String url = "jdbc:microsoft:sqlserver://804-R/LQ:1433";
Connection con=null;
Statement stmt=null;
try {
/**open the test database*/
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
System.out.println("Opening db connection"); con = DriverManager.getConnection(url,user,passwd);
stmt = con.createStatement();
}
catch (ClassNotFoundException ex) {
System.err.println("Cannot find the database driver classes.");
System.err.println(ex);
}
catch (SQLException ex)
{
System.err.println("Cannot connect to this database.");
System.err.println(ex);
}
对着做做,应该没问题的。
解决方案 »
- java.io.FileNotFoundException: D:\MyEclipse\apache-tomcat-(另一个程序正在使用此文件,进程无法访问。)
- 关于javamail发送邮件内容格式的问题
- 求教各位:JAVA EE 之路是如果走来的。
- 传递复选框值问题
- 在不同服务器运行的网页,怎样实现js传值
- struts2.0 中 sitemesh 异常问题
- Criteria 中 Restrictions.like("name", "%张三%"); 查询不到结果
- 请问怎样让JAR包在后台运行?就是我把SSH窗口关闭后没有影响
- 如何在JSP页面中给一个字符串赋带%>的值?
- 有关一般门户网站的这个问题有问该如何解决,谢谢!
- 哪里有可用的rational XDE下载
- 哪位高手用过JFreeChart的 ?
classpath里去