这和JDBC连接SQL Server的程序非常相似。只是协议不同而已。很多Java、J2EE服务器端编程书籍都有介绍。
解决方案 »
- hash值
- 不要在构造函数中调用可重写的方法
- 新手提问啊
- java程序中,能被一个数整除是用"%"还是"/"?
- jspsmartupload的一个问题
- 怎样将一个数组的所有元素都清理为0???
- 如何将String类型转换为Clob以进行写操作呢?
- 各位大侠java中怎么创建文件夹???
- 我想问一下,考到SCJP的证,在去从事Java开发的年薪是多少???,有没有钱途???
- 斑竹,各位大虾,问题又来了!
- 想用java做毕业设计.各位大虾能不能帮忙定个题目,谢谢了。
- 我已经完全安装了JDK1.3,但是我的IE是6.0办的,听说没有JAVA虚拟机,不知我的IE能不能运行JAVA程序?是不是一定要装IE6以下的?
你先下载MYSQL和它的JDBC驱动程序,按下面的配置走一遍.(肯定没问题)
成功后再做SQL Server,就会轻车熟路了!
俺也没SQL Server的JdBC驱动程序,所以也没法试! 1) Go to JDBC Explorer and select "View | Options" from the menu. Click on
the "Drivers" tab and then Click on the "Add" button. Key in the MySQL driver name (I use the one from Mark Mathews):
org.gjt.mm.mysql.Driver and press OK. You can enter a sample URL if you like e.g.
mysql://localhost/databasename 2) Go back to JBuilder.
Click on the "Tools | Enterprise Setup" menu option.
Click on the "Database Drivers" tab and the click on the "Add" button.
On the "Select One or More Libraries" dialog click on the "New.." button
Enter the MySQL driver name in the "Name" field i.e.
org.gjt.mm.mysql.Driver
Then click on the "Add" button for Library paths and search/select the
MySQL driver jar file and click "OK" button:
mm.mysql.jdbc-1.2b
Then go back through the panels click on "OK". I think you should then find that the driver is available for you to use. 3) When you setup a new connection module the MySQL jdbc driver should now
be available and if you set up a "sample URL" in JDBC explorer you should
just have to overtype the database/password details to get it working 语句用
Class.forName(DriveName);
Connection conn = DriverManager.getConnection(url,username,password);
{
int count = -1;
Connection con = null;
Statement stmt = null;
try {
con = myBroker.getConnection();
stmt = con.createStatement();
ResultSet results = stmt.executeQuery(sqlstr);
ResultSetMetaData rsmd = results.getMetaData();
results.next();
count = Integer.parseInt(results.getString(1));
results.close();
}
catch (Exception e)
{
;
}
finally {
try{
if(stmt != null){
stmt.close();
}
}catch(SQLException e1){};
}
// The connection is returned to the Broker
myBroker.freeConnection(con);
return count;
}
ClassPath没有改变,但是可供改变ClassPath的文件InterClient。jar又没有在解压后的文件夹下找到,可能是下载不完整吧。请问该怎么办。我没装JDK,我是通过访问另外一台机子。