archonLing
发贴: 57
积分: 10
|
于 2003-06-28 21:30
It is standard JDBC connection using Sybase's JConnect 5.x.
import java.sql.*;
.....
try { Driver sybaseDriver = (Driver)Class.forName("com.sybase.jdbc.SybDriver").newInstance(); DriverManager.registerDriver(sybaseDriver); String conURL = "jdbc:sybase:Tds:[dbserver Name]:[port#]";
Connection con = DriverManager.getConnection(conURL, [user], [pwd]); .... } catch (Exception ex){
}
I hope it helps. BTW, it is a better pratice to seperate Presentation from Business Logic (MVC model). So, it is cleaner to handle this in a bean instead of on jsp page. It is just my 2 cents.
|