Re: R: R: App + ConnectorJ + MXJ deployment
Eric Herman <[email protected]>
| Newsgroups | gmane.comp.db.mysql.java |
|---|---|
| Message-ID | <1159354698.4612.23.camel@localhost> |
Hello Roberto,
Please, let me suggest an alternative approach.
Step 1: Copy ConnectorMXJObjectTestExample.java to something of your
own, like "RobertoTest.java
Step 2: Alter RobertoTest to use a "basedir" and port of your choosing.
File ourAppDir = new File("C:\roberto_test");
File databaseDir = new File(ourAppDir, "mysql-mxj");
int port = 3336;
MysqldResource mysqldResource = startDatabase(databaseDir, port);
Step 3: Confirm that "RobertoTest" succeeds.
Step 4: delete all of C:\roberto_test\mysql-mxj
Step 5: Follow paragraph 25.4.5.2 to jar up the "data" directory of the
Mysql database which you wish to include, and add that into your
connector-mxj.jar
Step 6: alter RobertoTest to use the user name (utente142), password
(pulsar), and database name (rua142) that work match the settings from
the mysql data dir that you added to the connector-mxj jar file.
Step 7: confirm that RobertoTest still succeeds.
If that all works, then it should be a simple set of changes to your
small java app to use Connector/MXJ.
Cheers,
-Eric
On Tue, 2006-09-26 at 10:56 +0200, tech wrote:
> Hi Eric,
>
>
>
> I'm back to the development machine willing to start from scratch.
>
>
>
> ===============================================================================
>
> STEP 1
>
>
>
> My small Java app (unaware of Connector-MXJ) runs properly and
> connects
>
> to MySQL Server on the default port 3306:
>
> · to my database “rua142”
>
> · with the username “utente142”
>
> · with the password “pulsar”
>
> · with the following JDBC URL Connection (with no explicit port
> reference):
>
>
>
> Connection dbConn =
> DriverManager.getConnection("jdbc:mysql://localhost/rua142?user=utente142&password=pulsar");
>
>
>
> ===============================================================================
>
>
>
> STEP 2
>
>
>
> I suppose I should make the Java app aware of Connector-MXJ by
> changing
>
> my Java class which manages the DB connection.
>
> Is the attached java file properly changed ?
>
>
>
> ===============================================================================
>
>
>
> STEP 3
>
>
>
> Is step # 3
>
> “Creating your own Connector/MXJ Package” and “Deploying Connector/MXJ
> with a pre-configured database”
>
> Following paragraph 27.4.5.1 and 27.4.5.2 of the online manual ?
>
>
>
> ===============================================================================
>
>
>
> Cheers
>
> Roberto
>
>
>
>
>
>
>
>
>
>
>
>
>
> -----Messaggio originale-----
> Da: Eric Herman [mailto:[email protected]]
> Inviato: lunedì 25 settembre 2006 14.03
> A: tech
> Cc: [email protected]
> Oggetto: Re: R: App + ConnectorJ + MXJ deployment
>
>
>
> Hi Roberto,
>
>
>
> At first glance, the only serious issue I see is that it looks like
> the
>
> port was forgotten in the JDBC URL connection string:
>
>
>
> > dbConn = DriverManager.getConnection("jdbc:mysql://localhost/" +
>
> > DATABASE + "?user=" + USERID + "&password=" + PASSWORD);
>
>
>
> That should really look more like:
>
>
>
> "jdbc:mysql://localhost" + port + "/" + ...
>
>
>
>
>
>
--
Eric Herman, Software Developer
MySQL AB, www.mysql.com
VoIP Ext: 6594 US: +1 408 213 6540 Europe: +46 18 174 400
Mobile: +31 [0]6-20719662
Are you MySQL certified? www.mysql.com/certification
--
MySQL Java Mailing List
For list archives: http://lists.mysql.com/java
To unsubscribe: http://lists.mysql.com/[email protected]