Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

accessing maxdb database from wsad

 
satish rn
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everbody,
i am trying to connect to maxdb database from wsad using jdbc. can you tell me how i can do so.
thanks in advance
satish
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34974
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to create a datasource with the connection information for that db. There are a bunch of samples for other databases like db2 and Oracle.
 
satish rn
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Jeanne,
thanks for the reply. i got the driver name to be given in the Class.forName(---) to connect to the database. but i am not able to instantiate the database. i installed maxdb on windows 2000. can you tell me how to start the database and create some tables there. In short, i would like to know the command to connect to connect to the database
thanks
satish
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34974
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Satish,
It looks like you are using plain JDBC (not a datasource) so your question isn't specific to WSAD. Starting the database should be explained in the instructions for your database. To access it, you should be able to use pure JDBC.
You may want to post your code that isn't working. (it would probably get a better response in the jdbc forum)
 
satish rn
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi jeanne,
this is the code i am using to connect to the database. the error i get using the code is because of the getConnection statement because, i donot have the maxdb database instantiated and there is no database named whistleblower in it. i would like to know how to instantiate maxdb database and create tables in it. i have installed the maxdb database from mysql.
thanks
satish
import java.sql.*;
public class TestClass2 {
public static void main(String [] args)
{
Connection con= null;
Statement stmt = null;
ResultSet rs = null;
ResultSet rs1 = null;
String username;
String password;
try
{
System.out.println("hi");
Class.forName("com.sap.dbtech.jdbc.DriverSapDB");
System.out.println("hello");
con =
DriverManager.getConnection("jdbc:sapdb://localhost/whistleblower");
}
catch(Exception e)
{
System.out.println(" hi " + e.getMessage());
}
}
}
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34974
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I get it now. Your question isn't really about java. JDBC assumes that you have everything set up. You need to create the whistleblower database by hand. You can do this through the command line or any gui tools provided by your database.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic