on 06-01-2007 8:25 AM
Hi Experts,
Im new in net weaver. I developed a CMP bean using EJB2 project. Now I want to connect with a table which has in MySql database. In net weaver MAXDB,ORACLE etc options are there, but MySql is not there. So pls help me for connecting MySql.
Thanks in Advance
Toji.
Hi Toji,
This is the code example for access to Oracle:
import java.sql.Connection;
import java.sql.DriverManager;
DriverManager.registerDriver(new <b>oracle.jdbc.driver.OracleDriver()</b>);
try{
Connection con = DriverManager.getConnection(serverName, db_user, db_pwd);
}catch(Exception e){
Logger.error(e.toString());
}
<b>oracle.jdbc.driver.OracleDriver()</b> is the driver for access to Oracle.
You can try using <b>com.mysql.jdbc.Driver()</b> for mySql (I have found it in google but I've never used it!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.