• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

accessing maxdb database from wsad

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 40793
828
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 40793
828
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 40793
828
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic