var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: JDBC URL to use the hostname syntax
Hi can anyone help me get my java application to connect to a DB2 v8.1 database.
I have a java application that connects just fine to DB2
for my string url i'm using
and the driver i'm using is
I'm running the application on the same computer as where my DB2 is installed.
But i dont knw where this 'mydatabase' is created on my computer and how i can use the hostname syntax? and wht is it? So that if needed i can connect to my db from different machine.
Can someone show me how to make a proper connection
You may use the driver "COM.ibm.db2.jdbc.net.DB2Driver",and write the URL like this:"jdbc:db2://hostname:6789/databasename"
Thanks for replying
but where this database will be created on my computer, in which folder?
Can u paste some example code for reference.
It doesn't matter in which folder the database files are: "databasename" in the example given by
somn is the name you specify in CREATE DATABASE - it will be cataloged on the server under that name.
But the problem is ,i want to create a database using db2's CLP on my machine and then i wish to connect to that database from my java code using jdbc URL.
And when i create database from CLP and to this DB i try to connect from jdbc it doesnt works and tables r not created in it but somewhere else.
I using db2e drivers to connect to db
String driver = "com.ibm.db2e.jdbc.DB2eDriver";
String url = "jdbc:db2e://localhost:6789/mysample";
SO i would like to knw how i can connect to mysample database from CLP of db2. Normal command
Connect to mysample works but it doesnt show the tables which r created from jdbc.