JDBC Driver for MySQL database which should support JDBC2.0 function
Hi, Guys,
I'm using JDK1.3 and mm.mysql-2.0.4-bin.jar in Windows NT. When I run following program, I got the error: java.sql.SQLException: ResultSet not updatable. (the function rs.last() is working).
Based on the documentation, mm.mysql-2.0.4-bin.jar driver should support JDBC2.0 function, but in fact, it's not. So, what's wrong or where is the correct driver?
Thank you in advance anyway!
import java.sql.*;
import java.sql.ResultSet.*;
import java.util.*;
public class BridgeMysql{
public static void main (String[] args) throws Exception {
String sTable = "test";
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
Connection conMysql = DriverManager.getConnection("jdbc:mysql://localhost/myDatabase?user=user&password=password");
Statement st = conMysql.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
ResultSet rs = st.executeQuery("Select * from "+sTable);
//rs.last();
rs.moveToCurrentRow();
System.out.println("Table "+sTable+" contains "+String.valueOf(rs.getRow())+" rows");
rs.close();
st.close();
conMysql.close();
catch (Exception e)
System.out.println(e);
Thought I might add something interesting I found.
You need to include the field in your primary key. I only have one field in the key so I dont know how it works if you have more than one key.
Makes sense considering Mark stated that you need the primary index defined. Looks like you need the fields as well from the select statement.
Can anyone comment on why this is?
Similar Messages
-
I want JDBC driver for Sybase database...
Hi All:
Can any one help me with JDBC driver for Sybase database ? I have surfed the net, but not able to find a Sybase driver that works correctly.
Also, can you please let me know if anything special needs to be done in case of Sybase database connection, apart from what we normally do to connect to a database like "Oracle" or "MS SQL Server".
Thanks and Regards,And why do you think someone using Oracle might know the Competitor's drivers?
Having said this: you should give jTDS a try:
http://jtds.sourceforge.net
Also, can you please let me know if anything special
needs to be done in case of Sybase database
connection, apart from what we normally do to connect
to a database like "Oracle" or "MS SQL Server".It's all in the docs of the driver -
Problem with JDBC driver for mysql
I have downloaded the Connector/J3.0 mysql-connector-java-3.0.7-stable.tar.gz from www.mysql.com/downloads/api-jdbc-stable.html web site and used gunzip and tar to extract the file. I have received the following error message:
tar: directory checksum error
Will this error cause some problem later on?
Which directory should I put the driver into? Can I put it in any directory?
Do I need to set the classpath for the driver? If yes, how can I set it?
What is the connect string? Can you give a sample for me? I am using Solaris 5.8 and mysql is on the same machine.
Thanks a lot,
Lisathis is an example of a connect string for mysql that i used...
public Connection CreateConnection () throws Exception
Connection myConn = null;
String driverName = "org.gjt.mm.mysql.Driver";
String dbUrl = "jdbc:mysql://www.desres.com/jhazrd?user=jhazrd&password=????";
Class.forName(driverName);
myConn = DriverManager.getConnection (dbUrl);
return myConn;
} -
JDBC Driver for Progress Database
Hi experts,
We need to connect our SAP PI 7.0 which is running on Windows 2003 Server x64 bit Standard/Enterprise Edition SP1 to a progress database 9.1D version on Unix. The problems are
1. What JDBC driver should I use?
2. We tried to copy progress JDBC driver jar files from the progress database installation directory into my windows machine and tried to run it, it fails to run. It gives the following error
Error during database connection to the database URL 'jdbc:JdbcProgress:T:156.5.31.65:inodbc2' using the JDBC driver 'com.progress.sql.jdbc.JdbcProgressDriver': 'com.sap.aii.adapter.jdbc.sql.DriverManagerException: Unable to locate a suitable JDBC driver to establish a connection to URL 'jdbc:JdbcProgress:T:156.5.31.65:inodbc2''
3. Does anyone know what connection architecture should I use to run under such environment?
Thanks
CharuHi,
To install JDBC driver follow the how to guide.
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/xi-how-to-guides/how%20to%20install%20and%20configure%20external%20drivers%20for%20jdbc%20and%20jms%20adapters.pdf
Configuration of JDBC Adapter for SQL Server
JDBC Driver = com.microsoft.jdbc.sqlserver.SQLServerDriver
Connection = jdbc:microsoft:sqlserver://hostname:<port>;DatabaseName=<DBName>
UserID and Password.
If the connection is not working find the correct port number.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40b92770-db81-2a10-8e91-f747188d8033
JDBC- X I - R/3 Scenario
/people/bhavesh.kantilal/blog/2006/07/03/jdbc-receiver-adapter--synchronous-select-150-step-by-step
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30
Please check the driver path as mentioned below.
JDBC Driver : sun.jdbc.odbc.JdbcOdbcDriver
Connection:jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=//location of DB table.mdb;
No JDBC driver required.
Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
follow this thread
Re: Problem when connecting to MS Access through JDBC Adapter.
SAP Note 850116 has details
Thanks,
Satya Kumar
Reward Points If it is Useful.. -
Where should I put JDBC driver for MySQL
I am trying to connect MySQL with JDBC 2.0 API. I have downloaded the driver file mm.mysql-2.0.4-bin. Where should I put this driver to make it run ?
According to mysql.org, it says "Put mysql.jar in your classpath". I am confuse by classpath. Is it same as the path ? or is another system variable.
thanks for clear my doubt. ^_^it is a different variable, but also in the same file (autoexec.bat) as path;
set CLASSPATH=%classpath%;C:\JDK1.3.0_02\bin;c:\path\mm.mysql-2.0.4-bin
Jamie -
How do I install the jdbc driver for sql server 2005, in sql developer 4.0 ?
Hallo together
I need access to tables in a MS SQL Server 2005 database.
One possibility is the JDBC driver.
How do i install this driver ?
Thank you very much for your postings.Hi,
This is from the documentation -
Database: Third Party JDBC Drivers
The Third Party JDBC Drivers pane specifies drivers to be used for connections to third-party (non-Oracle) databases, such as IBM DB2, MySQL, Microsoft SQL Server, or Sybase Adaptive Server. (You do not need to add a driver for connections to Microsoft Access databases.) To add a driver, click Add Entry and select the path for the driver:
For Microsoft SQL Server or Sybase Adaptive Server: jtds-1.2.jar, which is included in the jtds-1.2-dist.zip download
To find a specific third-party JDBC driver, see the appropriate website (for example, http://www.mysql.com for the MySQL Connector/J JDBC driver for MySQL, http://jtds.sourceforge.net/ for the jTDS driver for Microsoft SQL Server and Sybase Adaptive Server, or search at http://www.teradata.com/ for the JDBC driver for Teradata). For MySQL, use the MySQL 5.0 driver, not 5.1 or later, with SQL Developer release 1.5.
You must specify a third-party JDBC driver or install a driver using the Check for Updates feature before you can create a database connection to a third-party database of that associated type. (See the tabs for creating connections to third-party databases in the Create/Edit/Select Database Connection dialog box.)
Alternative:
As an alternative to using this preference, you can click Help, then Check for Updates to install the JTDS JDBC Driver for Microsoft SQL Server and the MySQL JDBE Driver as extensions.
Regards,
Mike -
Does anyone know of a JDBC driver for SQL Server 2000 that supports Windows Authentication?
Meaning a username and password does not need to be supplied when connecting to the database.
Thanks,
James.Yes.
JDBC-ODBC. -
JDBC driver for SQL Server 2000 with windows authentication
Does anyone know of a JDBC driver for SQL Server 2000 that supports Windows Authentication, that is that a username and password does not need to be supplied when connecting to the database.
You can use the JDBC-ODBC-Bridge.
ODBC provides windows-authentication.
Hope it helps.
Freddy -
Jdbc drive for oracle7.3.4 is not working for me
I try have download the JDBC Driver for Oracle7.3 which is 'jdbc73402-nt.zip'. When I run my testing program, I got this error message 'Exception in thread "main" LinkError: no oci804jdbc in java.library.path'.
I have compared the contents of the two classesXXX.zip files with 'jdbc80406-nt.zip'. There is no diffence between classes102.zip. The creation dates of the files are differnt between the tow classes111.zip. However the number of files and and size of each file in the two classes111.zip files are all the some.
I have also download the JDBC drive for oracle 8.0.5 for my othere pc. I can run my testing program without any problem.
Could you tell me why the jdbc73402 is looking for oci804jdbc not oci73jdbc?
Thank you very much for your help.Let's get your iPhone back up and running reeset12! My first recommendation is to try a soft reset by holding down the power and home keys. If the device doesn't respond, I recommend connecting it to a computer via the usb cable. If you are unable to get past the logo screen in either case, I recommend a hands on evaluation at a store location.
http://bit.ly/3SdsA
Sincerely,
JonathanK_VZW
VZW Support
Follow Us on Twitter@VZWSupport -
Where can i find mysql Jdbc driver for linux
Hi all,
Can any one give urls to download mysql jdbc driver for linux.
And also for ODBC DRIVER FOR MYSQL ON LINUX.
Thankshttp://mmmysql.sourceforge.net/
(This is a type 4 driver, so "for Linux" is irrelevant.) -
No suitable driver for mysql in oracle application server portal 10g
Hi all
i want to run my portlet with mysql4.1 database from "oracle application server portal 10g".
i did all configuration in data source and also i kept mysql connector jar file into all oraclehome/jdbc/jlib folder.
Mysql
General
Name :: helloMysql(jndiname)
Description :: helloMysql
Data Source Class :: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
JDBC URL :: jdbc:mysql://localhost:3306/database?relaxAutoCommit=true
JDBC Driver :: com.mysql.jdbc.driver
Datasource Username and Password
Username------------>(user name)
password-------------->(password)
JNDI Locations
Location== jdbc/helloMysql
jdbc/blogOracle== jdbc/XA/helloMysql
EJB Location == jdbc/XA/helloMysql
Connection Attributes
Connection Retry Interval (seconds)====1
Max Connection Attempts===empty
Cached Connection Inactivity Timeout (seconds)===30
remaing all are empty
when i run the portlet, then i am getting "No suitable driver" in my portal page.
i want check server console or server log for oracle application server portal.
please help ,where to find server log?
Any suggestions or help from your side.
Thanks in advance.
RajuI think you're trying to connect to a database in a diferent host than the Web Server.
This is possible in applcations, but not in applets, who only can open TCP connections to the same machine who served the page.
To do that, yo should use a Data Gateway to establish the connections (IDSServer, and so on). I think that installing Oracle's Connection Manager in the same machine than the Web, it would run.
null -
HI,
could please suggest me for which drivers are suitable to create data server of mysql.
please share any links for jdbc specification.
Regards,
SuryaHi,
You should have mysql-connector-java driver. you can down load from here http://dev.mysql.com/downloads/connector/j/
then use
JDBC Driver: com.mysql.jdbc.Driver
Url: jdbc:mysql://55.118.21.187:3306/dtbs3306
Thanks. -
How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.
If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
This page is a good starting point for learning about Flex and PHP communication:
http://www.adobe.com/devnet/flex/flex_php.html
Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/ -
Test JDBC Driver For SQL Server 2000 Failed
Hi:
I have trouble setting up the database connection using jdbc driver in the studio, could anyone help me please? I have MS SQL 2000 MSDE installed on my local machine. I downloaded and installed the JDBC Driver for MSSQL 2000 from Microsoft.
I put the following jar files into the/lib/ext/ directory
msbase.jar
mssqlserver.jar
msutil.jar
In Studio 4.1 EE, I went to Runtime>Databases>Drivers, Add a new Driver with these information:
Name: MSSQL Driver
Driver: com.microsoft.jdbcx.sqlserver.SQLServerDataSource
URL Prefix: jdbc:microsoft:sqlserver://localhost:<PORT>[;DatabaseName=<DB>]
Next I run the Test Driver...
Database URL: jdbc:microsoft:sqlserver://<machineName>\\<instanceName>;DatabaseName=<xxx>
User: <username>
Password: <password>
I receieved the a popup box and message in the output window:
Internal test driver incomplete. the driver may not support the required DatabaseMetadata methods. take a look at the Output Window for details.
Warning: No tables were found. Check your database.
Warning: No views were found. Check your database
Warning: No procedures were found. Check your database.
Your replies are greatly appreciated.
Perrycom.microsoft.jdbcx.sqlserver.SQLServerDataSource is a very old direct driver. I'd recommend using the DataDirect 3.2 driver. It can be found at:
http://www.datadirect-technologies.com/products/jdbc/jdbcindex.asp -
Using JSP & JDBC driver for SQL Server 2000 on Red Hat
I successfully have a .jsp app running on windows server 2000 using JDBC
driver for SQL Server 2000. Which I installed in order to the following
Red Hat:
http://msdn.microsoft.com/MSDN-FILES/027/001/779/install.htm
I moved the .jsp app over to the Red Hat 9 server running Tomcat, while
keeping the MS SQL 2000 on windows. The issue I have is setting up the
JDBC driver for SQL Server 2000 on the Red Hat server.
I created a folder called /usr/java/MSSQLdriver and unzipped the tar file with
the driver for SQL Server 2000. And ran the install.ksh script.
The /usr/java/MSSQLdriver/lib has the following files within it:
msbase.jar, msutil.jar, & mssqlserver.jar
I chmod 0777 each of the *.jar files.
I then went into /etc/profile.d/tomcat.sh and adding the following:
CLASSPATH=.;/opt/msSQLjdbc/lib/msbase.jar;/opt/msSQLjdbc/lib/msutil.jar;/opt/msSQLjdbc/lib/mssqlserver.jar
Each time I login and pull up the termial I get the following error:
bash: /opt/msSQLjdbc/lib/msbase.jar: cannot execute binary file
bash: /opt/msSQLjdbc/lib/msutil.jar: cannot execute binary file
bash: /opt/msSQLjdbc/lib/mssqlserver.jar: cannot execute binary file
And can't connnect to the database within the .jsp app.
Is there anyone out there using DBC driver for SQL Server 2000 on the Red Hat server?
MichaelSorry, I needed to correct some information of where the drivers were installed.
I created a folder called /usr/java/MSSQLdriver/new and untar the Microsoft file with the driver for SQL Server 2000. I ran the install.ksh script "sh install.ksh"
installed the driver into the default directory "/opt/msSQLjdbc".
The /opt/msSQLjdbc/lib has the following files within it:
msbase.jar, msutil.jar, & mssqlserver.jar
Michael
Maybe you are looking for
-
I can't seem to find a solution to this problem. My iPad was fine yesterday?
-
For every control in my project I have an orange box over the color picker not allowing me to change the color of any controls unless I manually set the color in the xaml code(which changes it successfully). Going on a certain resource dictionary pag
-
Hi , Our client's requirement is that when ever i create change number for any material, it should get displayed in the transaction CS12. It is not at all comming in the report CS12. Iam not sure about the role payed by the "validity period" of the c
-
Fill a table with data coming from an RFC
Hello everyone: I've followed the Weblog "How many lines of java code did i write for a simple Web Dynpro?" /people/durairaj.athavanraja/blog/2004/10/17/how-many-lines-of-java-code-did-i-write-for-a-simple-web-dynpro I've called an RFC and created a
-
BPS: No description in F4 help
Hello, I created a planning area and a web interface. In a variable 'Curency' I selected User-Specific Value. After that I select for a user a currency and use F4-help. In this help I could see all currencies values and there descriptions. I use this