OCUP UML fundamental and ITIL foundation
Jan Cumps wrote:
(note to self: on the other hand, when your jdbc driver is not on the runtime classpath, would that not have gotten this error: ClassNotFoundException ? )
Yes. I thought from your original post that you were running it from JDeveloper.Given that "C:\Documents and Settings\zanders\My Documents\Project Program\driver\mysql-connector-java-5.1.7\mysql-connector-java-5.1.7-bin.jar" is part of that, it looks to me like it's in the runpath as well. Am I interpreting that correctly?
OCUP UML fundamental and ITIL foundation
Zachary Anderson wrote:Jan Cumps,
I am indeed running it from JDeveloper. The first line in the "log window" (same place I get the results of my dummyprint statements) looks to be the call that JDeveloper makes to javaw.
I have switched out the previous getConnection statement with
and am getting
SQLException: No suitable driver found for jdbc:mysql://hostcomputer.workplace.here:3306/database?user=id&password=password
Am absolutely sure of hostcomputer.workplace.here, have compared it with the (successful) login with SQLYog.
As a bit of a head-check ( ) after reading up on DriverManager, I decided to see what Drivers were actually in the list.
I tried the code at http://java.sun.com/j2se/1.4.2/docs/api/java/util/Enumeration.html , but it looks like they have a bit of a mistake; since e is instantiated inside the start condition, it's not recognized in the body of the loop. Although that might be a JDeveloper mistake.
Anyways, running
gives me just
sun.jdbc.odbc.JdbcOdbcDriver@3e53cf
Does this mean I'm missing the driver I loaded, or is that a different name for it, or does the for-loop code miss the first item in the Enumeration?
Thanks again,
Zachary
OCUP UML fundamental and ITIL foundation
Zachary Anderson wrote:Would anyone be willing to suggest how to test this code? I'm not really sure for what DriverManager is looking.
Running JDeveloper, have included mysql-connector-java-5.1.7-bin.jar in the "libraries and classpath" window.
spits out
SQLException: No suitable driver found for jdbc:mysql://host/database
SQLState: 08001
VendorError: 0
The fact that I'm no longer getting a "Class strife" message gives me the impression that it has successfully found the Driver. I am able to connect to the database with SQLYog, so I think the database has no problems.
I'm planning on putting this on several computers, so putting it into .lib folders might be possible, but not ideal.
Suggestions?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |