• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connecting MySql through ODBC drivers in java

 
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
i want to connect mysql using odbc driver without creating datasource. can this be possible to connect mysql database using odbc driver wihout using data source
if yes then please help me. thanks in advance
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use ODBC. Use ConnectorJ, MySQL's own JDBC type 4 driver. It is written in pure Java and - unlike ODBC - doesn't need any setup on the machine it is used on. Furthermore, the JDBC-ODBC bridge has some specific problems. You should use ODBC only when an alternative doesn't exist.

It should be possible to google ConnectorJ easily.
 
asim satti
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
actually i want to know that if i use odbc driver to connect with mysql, is it necessary to create a data source for it, or i can connect without datasource
 
Martin Vashko
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you need to create a data source. After all, this is what ODBC is all about. There are several ways to set up a datasource (system, user, file etc.) and some of them might be easier than others.

Why do you want to use ODBC, against the official recommendation, instead of the MySQL native driver? It should be pretty easy to switch to ConnectorJ, if you're lucky, you need to change just the connection URL.

(You should also note that ODBC support will be removed from Java 8.)
 
asim satti
Greenhorn
Posts: 11
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok i got it thanks for help
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic