Hi Arne,
I surely wish I can understand the solution that you sent, but could not
figure it out. If you can detail a bit that would be appreciated.
Thanks
Joseph
>> I have used Linux on/off but lately I have been trying to get a
>> database connection to Java. MySql is working and tested. I also have
[quoted text clipped - 10 lines]
>
> Arne
Jon Martin Solaas - 17 Sep 2006 10:54 GMT
> Hi Arne,
> I surely wish I can understand the solution that you sent, but could not
[quoted text clipped - 17 lines]
>>
>> Arne
First search for jdbc tutorial on google, you'll get at least a million
hits and hello-jdbc-world examples.
Then, when you've found some reasonably simple and clean example, apply
the specials you need for working with MySQL:
1. Put the Connector/J in your classpath
2. Specify the correct driver classname in the java source where the
driver is loaded. The classname is documented in the Connector/J docs.
3. Specify the correct credentials so that you will be allowed to connect.
4. Change the SQL in the sample to suit your database tables, and the
restultset handling java code accordingly so that your javaprogram
matches the query result.
I do not think the world need yet another
jdbc-helloworld-tutorial-program, there's a nice example over at the
jdbc-pages at the Sun site, and you'll find plenty with google too.
Check it out and people will be more than happy to help you further if
you have more specific problems.
Arne Vajhøj - 17 Sep 2006 16:36 GMT
>>> I have used Linux on/off but lately I have been trying to get a
>>> database connection to Java. MySql is working and tested. I also have
[quoted text clipped - 8 lines]
>>
>> Driver name og Connection URL står i docs.
> I surely wish I can understand the solution that you sent, but could not
> figure it out. If you can detail a bit that would be appreciated.
There are fundamentally no differenvce betwene using MySQL
and any other database in Java. You use the JDBC interface.
You download the MySQL Connector/J to get the JDBC driver
for MySQL.
I can understand that you were puzzeled by my last sentence,
because that is in my native language.
It says:
Driver name and Connection URL is in the docs.
(the docs that comes with MySQL Connector/J)
Arne