Re: JDBC/mysql error...
- From: AL <lithar@xxxxxxxxxxxxxxx>
- Date: Wed, 14 Nov 2007 16:42:21 -0600
Roedy Green wrote:
On Mon, 24 Sep 2007 23:44:24 -0700, thushianthan15@xxxxxxxxx wrote,
quoted or indirectly quoted someone who said :
I got an error, when i tried to connect mysql with java. Any
suggestions ?
see the sample code at http://mindprod.com/jgloss/jdbc.html#CONNECTING
That was helpful to me - after failing to "upsize" my older Access database to SQL Server I decided to connect to the Access DB via jdbc-odbc. I did have to change one line of code in the example that was causing me a problem.
An excerpt from your page shows:
private static final String URL = "jdbc:odbc:";
<snip>
private static String getConnectionUrl()
{
return URL + ":" + DATABASENAME;
}
The ":" needs to be removed from the concatenation. I'm fairly new to Java so it took me a while to discover why my connection kept failing.
Thought you'd like to know.
Thanks for all your advice to this group.
AL
.
- Prev by Date: Announce: XML 2007 Conference
- Next by Date: Re: Connection and PreparedStatement
- Previous by thread: Announce: XML 2007 Conference
- Next by thread: Evaluating Business Intelligence Options for Software developers
- Index(es):
Relevant Pages
|
|