Jump to content
Sign in to follow this  
Followers 0

java DB connection?

5 posts in this topic

Posted

hi im trying to make a connection from java program to a mysql database .... how would I do this.... there are a few methods which i have brought up but im not sure which would be the best ?

Share this post


Link to post
Share on other sites

Posted

use spring JDBC. there are many tutorials out there and it's easy to use

here's the official documentation
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/jdbc.html

Share this post


Link to post
Share on other sites

Posted

http://dev.mysql.com/downloads/connector/j/

http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html

http://jdbc.postgresql.org/

Share this post


Link to post
Share on other sites

Posted

[quote name='psyko_x' timestamp='1353439556' post='595337120'] use spring JDBC. there are many tutorials out there and it's easy to use here's the official documentation http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/jdbc.html [/quote]

could you give me a simply walk through on install this on linux xD ? I am doing as it says but when i tried to compile it gave me seval thousand errors all to do with the new package?

Share this post


Link to post
Share on other sites

Posted

[quote name='SPEhosting' timestamp='1353452173' post='595337650']
could you give me a simply walk through on install this on linux xD ? I am doing as it says but when i tried to compile it gave me seval thousand errors all to do with the new package?
[/quote]
You may want to look into using maven when having to pull in libraries like Spring with multiple dependencies. Here's the dependencies though (in the "This artifact depends on ..." section): http://mvnrepository.com/artifact/org.springframework/spring-jdbc/3.1.2.RELEASE

Even simpler if you don't want to pull in spring to your project is just get the connector/j jar and use Java's built-in JDBC stuff. Spring's straight JDBC stuff doesn't buy you a whole lot except providing some mapping stuff to turn a ResultSet into an object saving you some boilerplate code.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.