Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Example Of Java Using Mysql


i have development experience with other languages and rdbms. now i am trying to learn java as well as mysql. can anyone share a simple java app that accesses a mysql table? or point me to any web resources that might have such a working example? i would like to see how one accesses a table stored in a local database.




View Complete Forum Thread with Replies

Related Forum Messages:
Java API To MySQL
--0-413911351-1058468110=:5477
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I want to know if there is java API to mySQL like its available for C and C++.

View Replies !
MySQL -- Java Vs PHP
Does Java work better than PHP with MySQL? What are pros and cons of using
Java or PHP? I am concerned Java may be slower than PHP with MySQL.
Can someone share the experience or point me to some good white papers or
benchmarks?

View Replies !
MySQL-- Java
I want to make a java-frontend for adding data to a mysql db, have anyone done this?
If so, how?

View Replies !
MySQL + Java
Basically i want a GUI frontend to connect to a database. My experience of this has been visual basic app and access database. The only thing i liked was that to deploy the user only needed the app and the database, deployment was simply packaging the 2 together.Can i make a database using mySQL and deploy it as in the example above? Or does the user need to have a mySQL installed ? Now i all read about databases mySQL/oracle is of a server running the database and the app connecting. However for my app the information will not be updated or changed and therefore i don't need to connect to a server to access the database?

View Replies !
Mysql And Java
I am using MySQL as a database and am trying to run a sample program to fetch and display data from a table...and dispaly like panel in database
.Please give me the sample code for that .ITs very urgent .I cannot complete my project until ur reply

View Replies !
Mysql Connector Java JAR
I am making a Java Applet connects to mysql database, it works well in
application mode. When I run it in applet mode, obviously the client
running the applet should have the mysql connector file
(mysql-connector-java-3.0.8-stable-bin.jar).

So the question is how to bundle this mysql jar file with my applet jar
file. I've tried to make both 2 files together in the html file:

archive="PCMApplet.jar;mysql-connector-java-3.0.8-stable-bin.jar"

the GUI shows up but the connection call to database is failed:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver
It seems to me that the mysql-blah.jar is not being used.

View Replies !
Transactions With Java And MySQL
I'm trying to port the use of postgresql db to mysql. I'm using
Java and having the following problem - I can't seem to write more
than 1 query per execution. Easier to explain with an example that
worked under postgresql and does not using mysql:

aStatement.executeQuery("BEGIN; DELETE FROM table1; DELETE FROM
table1; DELETE FROM table3; COMMIT;");

If I separate this into 5 different queries it works fine. Any
ideas?

View Replies !
Connecting To MYSQL From JAVA
i need to connect to a MYSQL database from a JSP... so i believe that if i learn how to connect to the MYSQL database through java... i can use the same method to connect through a JSP... anyways my question is does anyone know how to connect to mysql through java.

View Replies !
Connection Between Mysql And Java
I have a big problem, that is that in mysql, I send a Timestate data, and when I try to get it with java, I can't save it into any variable, neither string or Timestamp,

View Replies !
Java To MySQL Connection
I have Data in my MySQL DB. and I wont to use my java class to pull out information from my DB.
my class is this and I wont to add the code in the ***'s
public void getComunicate()
{
url = "jdbc:******:test";

try{
Class.forName("********".Driver");
con = DriverManager.getConnection(url, "MySQL", "1234");
}catch (java.sql.SQLException ex){
System.err.println("SQLException: " + ex.getMessage());

}catch (java.lang.ClassNotFoundException ex){
System.err.println("class not found: " + ex.getMessage());

View Replies !
Communicating With MySQL Through Java
In java is it possible for me to open a socket with a MySQL database and directly send infomation or would I need to use something like php as a buffer.

I know this isn't secure, but the application I am writing does not neet security. I'm just looking for some method to add information to a database. I made a simple .jar file mhich can do what I am looking for but I now I need something which I can upload to a remote webserver.

View Replies !
Mysql-connector-java-3.1.13-bin
I've MYSQL 5 installed and I want to connect to MYSQL using BIE JBOSS . I had put the jar file mysql-connector-java-3.1.13-bin.jar in the deploy/jboss/bie.sar folder and in windows environment I was able to connect to the MYSQL DB. But when I try doing the same in LINUX environment , I get the following error ,

Could not create connection; - nested throwable: (java.sql.SQLException: Cannot connect to MySQL server on <IP>:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.NoRouteToHostException)); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Cannot connect to MySQL server on <IP>:3306. Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.NoRouteToHostException)))


View Replies !
How To Ship Mysql Connector Java JAR
I am making a Java Applet connects to mysql database, it works well in
application mode. When I run it in applet mode, obviously the client
running the applet should have the mysql connector file
(mysql-connector-java-3.0.8-stable-bin.jar).

So the question is how to bundle this mysql jar file with my applet jar
file. I've tried to make both 2 files together in the html file:

archive="PCMApplet.jar;mysql-connector-java-3.0.8-stable-bin.jar"

the GUI shows up but the connection call to database is failed:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver

It seems to me that the mysql-blah.jar is not being used.

View Replies !
Ship Mysql Connector Java JAR
I am making a Java Applet connects to mysql database, it works well in
application mode. When I run it in applet mode, obviously the client
running the applet should have the mysql connector file
(mysql-connector-java-3.0.8-stable-bin.jar).

So the question is how to bundle this mysql jar file with my applet jar
file. I've tried to make both 2 files together in the html file:

archive="PCMApplet.jar;mysql-connector-java-3.0.8-stable-bin.jar"

the GUI shows up but the connection call to database is failed:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver

It seems to me that the mysql-blah.jar is not being used.

View Replies !
Connect To Mysql Server Using Java
i am trying to connect to mysql server running on different machine,from a java program. i am successful with mysql3.0. but with mysql5.0 -alpha i am getting the error like this..java.sql.SQLException: Server configuration denies access to data source.

View Replies !
Problem With MySql And Java Under Windows
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

import com.mysql.management.driverlaunched.ServerLauncherSocketFactory;

public class ConnectorMXJTestExample {
public static void main(String[] args) throws Exception {
String hostColonPort = "localhost:3306";

String driver = com.mysql.jdbc.Driver.class.getName();
String url = "jdbc:mysql://" + hostColonPort + "/" + "?"
+ "socketFactory="
+ ServerLauncherSocketFactory.class.getName();
String userName = "root";
String password = "";

Class.forName(driver);..................................................

View Replies !
Deleting Mysql Entries In Java
I am asking the user to put in a number and the java prog will look for the corresponding entry and delete it.

so far i have asked the user and stored their choice and now move onto the part of deleting the entry.

i need to call the method for deleting and pass the parameter of the user´s entered number to it.

if im taking the right approach or if "DAO" patterns would be more useful?

View Replies !
Java Mysql Show Table Status
I am using java to retrieve a resultset with "show table status" mysql
command. I am having problem reading the [name] and [engine] column.
In the metadata object it is showing as VARCHAR but when I do
getString() it is returning me the object string (e.g. "[B@1e3e7d2")and
not the actual database value. I am using Mysql 4.1 and jdbc driver
3.1. I tried getB/Clob, getBytes, getCharacterStream() and none of
them is working.

View Replies !
Java In Linux (Redhat 9) To Access MySQL
Using a Java program, I can connect to the test database in MySQL. The
test database is installed using a MySQL utility, and it can be accessed
by any user without supplying a password. The relevant lines in my Java
(Java version 1.4.1) code are:

Connection con = null;
String url = "jdbc:mysql:///test"; // <== no user or password specified
con = DriverManager.getConnection(url);

However, when I try to connect to the accounting database (built as one
follows the Larry Ullman's "MySQL" book), the program fails. I need to
supply a user and a password. The relevant lines are now:

Connection con = null;
String url = "jdbc:mysql:///accounting?user=root&password=pswd"; // <==
con = DriverManager.getConnection(url);

I cannot get a connection. The error message is:

"Invalid authorization specification: Access denied for user:
'root@thorvald' (Using password: YES)"

(thorvald is my machine name.)

I have tried all sorts of variations on the url, trying to access the
accounting database, with no success. I can use the same user/password
of root/pswd within the mysql monitor to access anything I want.

Any ideas?

Again, I am using Linux (Redhat 9) , Java 1.4.1, MySQL 4.0.13, and the
MySQL ConnectorJ 3.0.8 (for Java access to MySQL).

View Replies !
Difficulty Connecting To Mysql Database From Java
Unable to connect to any hosts due to exception:

java.security.AccessControlException: access denied
(java.net.SocketPermission localhost resolve)

What is causing this error? is it a MYSQL or JAVA/JSP Problem, i cant
seem to work this out ?

View Replies !
Connecting Java With MYSQL In Wamp Server
import java.sql.*;

public class Connect
{
public static void main (String[] args)
{
Connection conn = null;

try
{
String userName = "root";
String password = "";
String url = "jdbc:mysql://localhost/test";
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
conn = DriverManager.getConnection (url, userName, password);
System.out.println ("Database connection established");
}
catch (Exception e)
{
System.err.println ("Cannot connect to database server");
e.printStackTrace();
}
finally
{
if (conn != null)
{
try
{
conn.close ();
System.out.println ("Database connection terminated");
}
catch (Exception e) { /* ignore close errors */ }
}
}
}
}


I have doubt that it is happening since MySQL is in C:wampMySQl.??
This is the output of StackTrace();

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at Connect.main(Connect.java:14)

View Replies !
Connecting To A Remote Mysql Server From A Java Application On Another Machine
i've a java application on a (remote/network) machine and mysql running on my local pc.other users who have access to that remote machine must be able to run that java application which will have to get data/send data to the server(/DB) on my local PC. i was able to run the application when its on my local pC using localhost in the connection string. But, now how do i set the connection string so that the java application accesses the DB (/server) from my local PC?

View Replies !
Java And Php
I would like to connect mysql from java, i have downloaded MyODBC but
i have a problem.can any 1 solve?

View Replies !
Java.sql
java.sql.SQLException: Server connection failure during transaction. Due to underlying exception:

'java.lang.ArrayIndexOutOfBoundsException: 40'.
Attempted reconnect 3 times. Giving up.

I don't understand why there is an array out of bounds exception. my host is localhost:3306 and i already verified my username and password. I granted access on all db but it displays zero changes. what does this mean? i am using mysql server v4.1.7-nt on winxp
does this have anything to do with mysql configuration.

View Replies !
How To Use Java Connector?
I downloaded MySQL Connector/J. How do you connect this to a MYSQL database server
on another machine? I want to use some Java code to connect to this from the client machine?

View Replies !
Java.sql.SQLException
Currently im trying to use java and mySQL together using JDBC.
But i've encountered an error message when i execute my codes.

-->ERROR: java.sql.SQLException: Access denied for user "@'localhost' (using password:YES)

before this error message, they printed this:

"Tue 13 Sep 12:55:31 SGT 2005 TRACE:"

i guess it has got to do with this part of my code:
conn = DriverManager.getConnection("jdbc:mysql://localhost/foaf", "", "abcde");

View Replies !
Connect Database From Java And Php
I would like to connect mysql from java, i have downloaded MyODBC but
i have a problem.

View Replies !
Java Null Values
How can I set null on a TEXT or VARCHAR field ?

I've tried using the PreparedStatement.setNull(int, int) method but seem to
get no joy, it defaults to the empty string as soon as I re-read the data
back.

View Replies !
Java.lang.NoClassDefFounfError
I'm trying to test my connection to the mysql driver, and i keep getting this message:

Exception in thread "main" java.lang.NoClassDefFounfError: Jdbc11

Jdbc11.java compiles ok.
I'm using
j2sdk1.4.2_08
mysql-connector-java-3.1.8a.tar
mysql-essential-4.1.11-win32
Wind XP

path = %SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;C:Program FilesFichiers communsAdaptec SharedSystem;C:Program FilesMySQLMySQL Server 4.1in;%JAVA_HOME%in

where JAVA_HOME = "C:j2sdk1.4.2_08"
and i also created a variable CLASSPATH = "C:mennendownloadsconnectorJmysql-connector-java-3.1.8a.tar"

I also put the mysql-connector-java-3.1.8a.tar in the C:j2sdk1.4.2_08jrelibext directory.

I've tried a lot of things i've read on forums, but it just doesn't wanna work
I also tried executing it with
java -cp .;C:mennendownloadsconnectorJmysql-connector-java-3.1.8a.jar Jdbc11
but it still won't work!

Here is Jdbc11.java ....

View Replies !
Sun Java Studio Ent. 8 Connectivity
My problem comes when I attempt to connect to my MySQL database using Suns Java Studio Enterprise 8 IDE. I added the C:MySQL jarmysql-connector-java-3.1.13mysqk-connector-java-3.1.13.bin.jar to the class path and to the database driver path

The driver is defaulted to ==> org.gjt.mm.mysql.Driver
The database url is ==> jdbc:mysql://localhost:3306/test
User Name is ==> root
and the password is == ***** (This is the same User name, password and database that I have used/created using MySQL Administrator.)

When I attempt to test my connection I receive the following exception thrown.
****************************************************************************************
Annotation: Exception occurred in Request Processor
java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.netbeans.modules.db.explorer.DatabaseConnection$2.run(DatabaseConnection.java:443)
at org.openide.util.Task.run(Task.java:189)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:330)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:721)
*****************************************************************************************
MySQL is installed in C:Program FilesMySQLMySQL Server 5.0...
Should the db url reflect this location?

View Replies !
Java Empty Resultset
I create some java code to get data from a table. Everything is fine. Except, that the ResultSet is empty, i.e. it contains no data, it is not null, though. BUT the table has data in it, if I execute the sql-statement directly in mysql, it works fine. Here is my code: Code:

View Replies !
How To Get The Last ID In From My Table By Connecting From Java
I am trying to get the ID of the last row of my table by following code

ResultSet rs = stmt.executeQuery("SELECT MAX(visitorInfoID) FROM visitorInfoTable");
System.out.println(rs.getInt("visitorInfoID"));

I am sure that this field is Integer.
But when I execute the program then I get the answer by Java Exception:
java.sql.SQLException: Column 'visitorInfoID' not found.

How can I get the last ID of the last row in my table??? Why this doesn't work?

View Replies !
Update Table With Java
im trying to update my table bunt

int test=5;
String update="Update bunt SET buntnr='test' Where bunt_ID ='ver.bunt_ID'";

wich results in this error

Data truncation: Out of range value adjusted for column 'buntnr' at row 1

If i use this, changing variables to ínt it works fine!
String update="Update bunt SET buntnr=5 Where bunt_ID =1";

View Replies !
Connecting To Database Using Java
i am able to connect to mysql database located at localhost:3306 inside tomcat. But i wanna do it in stand alone command line java program.

this is what my code looks like:

com.mysql.jdbc.jdbc2.optional.MysqlDataSource d = new com.mysql.jdbc.jdbc2.optional.MysqlDataSource();

Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY, provider);
ctx = new InitialContext(prop);

ctx.bind("jdbc:mysql://localhost:3306/bsidb", d);

// where provider is a string equal to "com.sun.jndi.fscontext.RefFSContextFactory"
// and bsidb is my database name

when i do the look-up it successfully returns the datasource.
and when i do getconnection
it returns a connection to the datasource.

the problem is when i do query... it returns an SQLException: No database selected

i am not using any config files because as i've said, i will do the connection using stand alone java program.
i use mysql4.1 and mysql-connector-java-3.0.16-ga-bin.jar, fscontext.jar are in my classpath.

View Replies !
About Java Driver In Solaris 10
I am planning to take admission to MCA and also planning to do my project using Solaris platform can anyone tell me how to configure MySql on Solaris as well as how to use database connectivity with java i have downloaded connector for java but its not working.

View Replies !
[java] Jdbc, More Than One Sql Command
I use Connector/J ver. 3.0 (downloaded from mysql.com).

Does anybody know why I cannot execute something like that in my Java
program:

stat.execute("CREATE TABELE a(b int);INSERT INTO a(b) VALUES(1);");
???

something like this works fine:
stat.execute("CREATE TABELE a(b int);");
stat.execute("INSERT INTO a(b) VALUES(1);");

i was trying to change the string:
"CREATE TABELE a(b int);
INSERT INTO a(b) VALUES(1);"
"CREATE TABELE a(b int); INSERT INTO a(b) VALUES(1);"
and nothing works.

Can anyone tell me why this jdbc driver cannot take this??? If I put the
string:
"CREATE TABELE a(b int);INSERT INTO a(b) VALUES(1);"
into mysql console everthing works fine....

I don't get it. I was trying to run it in pg, and evertyhing worked fine.

View Replies !
Data Types/Java
If I want "users" to have a list of "assignments", how can I implement this?

Also, i'm trying to access a mysql database from a java program.

View Replies !
Insert Timestamp With Java
I'm trying to insert Data into a Mysql Timestamp field, but everytime i try I get the following Exception, "com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data truncated for column 'Startzeit' at row 1", and the field ist set to 0000-00-00 00:00:00 (phpmyadmin view).

The Data I want to insert is a TimeMillis()/1000 to get the seconds and if I want wo insert it with connection.executeUpdate(SQL) it does't work, but if I take the SQL-Statement an try it in phpmyadmin, no error occurs.

I also tried a java.sql.Timestamp Object with .toString() with the same result.

Can anyone give me a hint, or does anyone know how to fix it?

View Replies !
Java Applets - Editable?
am i right in saying java applets that are like "whatever.class" that run in browsers are compiled code and therefore *un*reverse-engineerable?

View Replies !
Executing Java Methods From Database
I want to store particular algorithms written in Java into a database
(preferably MySQL) and then be able to accept values such as algorithm
type and parameters from a user (via JDBC) which will select the
algorithm from the database, excecute it and return the result. I
understand that MySQL does not support Java object types, so does
anybody have any suggestions on how I could implement this? Will I
need to compile the code and then store this into my database?

View Replies !
Communication Failure During Handshake. 4.1 Java
Since I have installed mysql 4.1 I am getting this error on trying to
reach the db:

java.sql.SQLException: Communication failure during handshake. Is
there a server running on localhost:3306?

Mysql is running OK. I can access it with the command prompt, telnet,
sqlyog, but not Java.

I have tried using mysql-connector-java-2.0.14-bin.jar and
mysql-connector-java-3.1.3-beta-bin.jar. I am sure that the classpath
is OK, the url, user, password etc - I have had it all working with
mysql 4.0 for months, no problems. I just wanted to be able to use
subselects - but if I can't resolve this soon, I will have to return
to 4.0 .

View Replies !
Stops Responding Connection With Java And PHP
I am using mysql 3.*. I have several php scripts and java programs which access the mysql server. But from yesterday both my java and php programs keep on waiting for the mysql server. Everything worked well for about 2 days. All started yesterday.

Mysql and my java and php programs are running on linux. Linux has glibc 2.2.*

View Replies !
Call Java From A Trigger After Row Insertion?
I need to write a MySQL trigger that will call (or somehow ultimately call) a Java method.

Is there a way to do this? If so, please point me in the right direction (document reference or example) and the best route for this.

I am trying to design something that, when a row is inserted into a table will do an insert into another database (could be any database anywhere) and thought of simply invoking a Java class and make that class/method

1. insert to the DB (jdbc) if it is on the same machine
or
2. Call a servlet and do a form post of the data that would then
insert into whatever DB it needs to using JDBC , or whatever (then confirm).

There are possibly other options, but I want to design this with a minimum amount of moving parts as possible.

View Replies !
Java.net.SocketException: Too Many Open Files
I am running an application on a Websphere app server and when i tried connecting today i kept getting this error < java.net.SocketException: Too many open files >..any pointers to how i can resolve this.

View Replies !
Timestamp Not Updating Thru Java/JDBC
I'm doing updates to records thru Java and JDBC but the timestamp field doesn't update.

An example:
Address has only two fields
Line1 - varchar(40)
UpdateTime - timestamp

ResultSet rs = this.doQuery("SELECT * FROM address WHERE address.key = 1", true);
rs.updateString("Line1", "street addr");
rs.updateRow();
The above does not UpdateTime

If however I do a query
"Update address set line1 = 'street addr' where address.key = 1"
Then the timestamp is updated.

View Replies !
Low Speed While Reading ResultSet In Java
I have a query to MySql table in my servlet. The table is really small, approximatly 20x20. Reading it through ResultSet takes several seconds(!). I traced the code and find out that getting every string takes almost a second(!!!), there could be no mistake!

Similar things happens with other tables. The time could change from query to query. Running the same queries through MySql console takes no time at all.

Connecting, quering are ordinary.

Everything installed on the same machine, Windows2000. Resin v.2.1.6, Caucho's jdbc driver Mysql 2.1.0, JDK 1.4.

View Replies !
Replicate Encode()/decode() Algorithyms In Java?
I have an existing database with user's passwords stored/retrieved as:

encode(password, 'saltString') / decode(encodedPasswordFromDB, 'saltString')

I know passwords shouldnt be stored this way - thats another story!

Anyway, Im migrating to Hibernate and would rather not have to write any SQL. If I can replicate what encode()/decode() does in Java code then I can avoid having to write any SQL code. If I cant achieve this then I will lose the ORM advantages of Hibernate since I will need to write the SQL querys myself in order that I make use of the native MySQL encode()/decode() functions.

Does anyone know if its possible to recreate what these functions do in Java?

For example - Doing a SELECT
-----------------------------
I let Hibernate do the ORM for me and get the encoded password from the database - then I use Java to replicate what decode() does to get my plain text password.

View Replies !
How To Update A Table Using Values From Java ArrayList
I have a schema called Times with the following tables "machine_ID, numTime, timeDiff. In my java code, I have an ArrayList called machine_Time containing integer values which I want to insert into timeDiff. timeDiff has currently only '0' values. The part of my code is as follows:

PreparedStatement ps;

ps = con.prepareStatement("UPDATE Times SET timeDiff = ? WHERE machine_ID = 3000");
//the values to insert
for (int m = 0; m < machine_Time.size(); m++){
int mysql = ((Integer)(machine_Time.get(m))).intValue();
ps.setInt(1, mysql);
ps.executeUpdate();
}

View Replies !
Communication Link Failure: Java.io.EOFException, Underlying Cause: Null
When I connect to the MySQL server (4.0.16 on Linux) using mysql and let the
tool sit for a couple of minutes, I get the following error.

mysql> use mysql;
No connection. Trying to reconnect...
Connection id: 50791
Current database: *** NONE ***

Database changed
mysql> use mysql;
Database changed
mysql>

The Java programs are displaying a similar error --> "java.sql.SQLException:
Communication link failure: java.io.EOFException, underlying cause: null"
No errors in the MySQL logs.
The max_connections are set to 1000. Why am I losing my connection to the
database?

View Replies !
How To Pass A Java.util.Date Object To A DATETIME Column Definition?
I am writing to a MySQL table via JDBC. I have some column definitions with type DATETIME. Here is my table definition:

mysql> describe sessions;

+-----------------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------------+-------------+------+-----+---------+-------+
| uid | int(11) | | PRI | 0 | |
| site_id | varchar(32) | | | | |
| session_id | int(11) | | | 0 | |
| context | varchar(32) | YES | | NULL | |
| create_time | datetime | YES | | NULL | |
| expiration_time | datetime | YES | | NULL | |
+-----------------+-------------+------+-----+---------+-------+
6 rows in set (0.00 sec)

My statement text is: Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved