File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes accessing maxdb database from wsad Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "accessing maxdb database from wsad" Watch "accessing maxdb database from wsad" New topic
Author

accessing maxdb database from wsad

satish rn
Greenhorn

Joined: Mar 12, 2004
Posts: 11
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

Joined: May 26, 2003
Posts: 31054
    
162

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.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
satish rn
Greenhorn

Joined: Mar 12, 2004
Posts: 11
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

Joined: May 26, 2003
Posts: 31054
    
162

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

Joined: Mar 12, 2004
Posts: 11
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

Joined: May 26, 2003
Posts: 31054
    
162

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: accessing maxdb database from wsad