Connect MySQL with d2k
Please help me to connect MySQL with Oracle developer 2000.
i try to make a servlet which make the connection with
mysql by jdbc. the compilation is good but when i
execute i have :
[root@ classes]# java FoncConnexion
java.lang.NoSuchMethodError: main
at
at
at
t
java.lang.Throwable.fillInStackTrace(Throwable.java:nat
ve)
at
at java.lang.Throwable.<init>(Throwable.java:38)
at java.lang.Error.<init>(Error.java:21)
at
at
at
t java.lang.LinkageError.<init>(LinkageError.java:21)
at
at
at
t
java.lang.IncompatibleClassChangeError.<init>(Incompati
leClassChangeError.java:21)
at
at
at
t
java.lang.NoSuchMethodError.<init>(NoSuchMethodError.ja
a:21)
What does it mean?
what can i do?
ThanksIt means there is no main() method in your class. If you want to execute it, u have to create a main method first.
Similar Messages
-
How to connect JSP with MySql Database?
HI All...
I want to know or How to connect Mysql with JSP or JSF any other software is available? please help me.....I want to know or How to connect Mysql
with JSP or JSF any other software isavailable?
please help me.....First you need to find 25 m of a CatV cable and...The DB files need to be located on the ninth device of a SCSI Daisy Chain with the total SCSI cable length being over 150 m (and the devices (and cables) need to be mix of Differential and Non-Differential).
Edit: And forget the terminator, who needs it? -
How to connect portal with msaccess database
we have to develop oracle portal applications with msaccess as a back end.how to connect portal to access.
thanks in anticipation.I want to know or How to connect Mysql
with JSP or JSF any other software isavailable?
please help me.....First you need to find 25 m of a CatV cable and...The DB files need to be located on the ninth device of a SCSI Daisy Chain with the total SCSI cable length being over 150 m (and the devices (and cables) need to be mix of Differential and Non-Differential).
Edit: And forget the terminator, who needs it? -
Can' t connect Java with MySQL
My goal is to connect Java with MySQL. I found many solutions on Internet, but I always get the same mistake:
SQLException: No suitable driver
SQLState: 08001
VendorError: 0MySQL works fine alone or with php.Only thing left me to think is that the installed versions are not compatible for this mysql-connector-java-5.0.4
I don't believe that could be a reason.
Installed versions are:
Apache Tomcat 5.5.20 Server
Apache HTTP Server 2.2.4
PHP 5.2.0
MySQL 5.2
jre 1.5.0_11
jdk1.5.0_11
Apache Tomacat JK2 connector Version: 1.2.20 File Name: mod_jk-apache-2.2.3.so
mysql-connector-java-5.0.4
I also set connector in class path: C:\mysql-connector-java-5.0.4;C:\mysql-connector-java-5.0.4\mysql-connector-java-5.0.4-bin.jar;C:\mysql-connector-java-5.0.4\src\com\mysql\jdbc
For installation I used manulas from:
http://apacheguide.org/jsp.php
http://doc.51windows.net/mysql/?url=/MySQL/ch23s03.html
Here is also a test code in java:
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Connect
public static void main (String[] args)
Connection conn = null;
try {
conn =
DriverManager.getConnection("jdbc:mysql://localhost/first_test" +
"user=monty&password=greatsqldb");
// Do something with the Connection
} catch (SQLException ex) {
// handle any errors
System.out.println("SQLException: " + ex.getMessage());
System.out.println("SQLState: " + ex.getSQLState());
System.out.println("VendorError: " + ex.getErrorCode());
}i'm desperate, please help or tell me someone who'll know the answer.
Thank You in advancehey buddy .. it seems yr code is wrong .. in getconnection () method u should also specify the port ,which u r not doing ...
the default port for MySQL is 3306 ... see below i am giving you a sample code ... its working fine .. and dont forget to put the MySQL driver jar path in to classpath and also copy the jar into common/lib folder of your tomcat ....
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class MySQLConnectionTest {
public static void main(String[] args) {
new MySQLConnectionTest().connTest();
public void connTest() {
String tableName = "portfolio"; //change as per setting
String hostName = "10.81.9.39"; // please change for the target database ip or hostname
String dbPort = "3306"; //change if not using the default
String dbName = "tradingsystem"; //change as per the given DB name
String username = "root"; //change as per setting
String password = "password"; //change as per setting
System.out.println("before try");
Double data=0.0;
Double data1=0.0;
try {
Class.forName("org.gjt.mm.mysql.Driver");
System.out.println("before driver manager");
Connection conn = DriverManager.getConnection("jdbc:mysql://"+hostName+":"+dbPort+"/"+dbName, username, password);
String query1 = "select * from "+tableName+" where User_id='trader1' and Stock_Type='Equity'";
System.out.println("quesry1="+query1);
Statement stmt = conn.createStatement();
ResultSet rs1 = stmt.executeQuery(query1);
while(rs1.next())
System.out.println("hiiiiii for rs1");
System.out.println(rs1);
Quantity=(Integer)rs1.getObject(5);
MarketPrice=(Double) rs1.getObject(8);
data=Quantity*MarketPrice;
data1+=data;
System.out.println("data1="+data1);
i=0;
rs1.close();
stmt.close();
conn.close();
} catch (ClassNotFoundException e) {
e.printStackTrace(System.err);
} catch (SQLException e) {
e.printStackTrace(System.err);
i hope it will work for u...
cheers, -
How to connect mySQL database with jdbc
Who can tell me how to connect mySQL database with jdbc? Thanks
http://onesearch.sun.com/search/developers/index.jsp?and=connect+mysql&nh=10&phr=&qt=¬=&field=title&since=&col=devforums&rf=0&Search.x=24&Search.y=16
-
How to connect MySql database with JSP
Dear everyone,
how to connect MySql database with JSP......It's too bad that nobody has ever asked this question before...
-
How to connect APEX with MYSQL via Apex's Database link
How do i connect APEX with MYSQL via Apex's Database link? The OBE doesn't go into specific detail about how to link the two.
can someone please elaborate on what these are and where i can find them in mysql:
Database Link Name
Connect To Schema
Password
Remote Hostname or IP
Remote Host Port
SID or Service Name
I need to link to mysql database so I can set up a 3D pie chart in apexHi jononioo
A database link is a device for connecting between Oracle database instances only. Oracle does have a method for connecting to other database systems (Transparent Gateway) but this is restricted to other commercial databases and I don't believe there is a gateway for Mysql. (I could be wrong)
I don't know Mysql but maybe there is some way to push data to the Oracle instance. Other than that, is there any reason why the data has to reside in the Mysql database?
Regards
Andre -
MySql with JBoss connection refused
hello,
I am using MYSql with JBOSS, but while running starting JBOSS it
gives
Connection refused error:
MySqlDB] at java.net.PlainSocketImpl.socketCon
MySqlDB] at java.net.PlainSocketImpl.doConnect
MySqlDB] at java.net.PlainSocketImpl.connectTo
MySqlDB] at java.net.PlainSocketImpl.connect(U
MySqlDB] at java.net.Socket.<init>(Unknown Sou
MySqlDB] at java.net.Socket.<init>(Unknown Sou
MySqlDB] at org.gjt.mm.mysql.MysqlIO.<init>(My
MySqlDB] at org.gjt.mm.mysql.jdbc2.IO.<init>(I
MySqlDB] at org.gjt.mm.mysql.jdbc2.Connection.
159)
MySqlDB] at org.gjt.mm.mysql.Connection.connec
MySqlDB] at org.gjt.mm.mysql.jdbc2.Connection.
va:89)
MySqlDB] at org.gjt.mm.mysql.Driver.connect(Dr
MySqlDB] at java.sql.DriverManager.getConnecti
MySqlDB] at java.sql.DriverManager.getConnecti
MySqlDB] at org.opentools.minerva.jdbc.xa.wrap
nnection(XADataSourceImpl.java:118)
MySqlDB] at org.opentools.minerva.jdbc.xa.wrap
nnection(XADataSourceImpl.java:151)
MySqlDB] at org.opentools.minerva.jdbc.xa.XACo
(XAConnectionFactory.java:246)
MySqlDB] at org.opentools.minerva.pool.ObjectP
ol.java:819)
MySqlDB] at org.opentools.minerva.pool.ObjectP
a:569)
MySqlDB] at org.opentools.minerva.pool.ObjectP
a:521)
MySqlDB] at org.opentools.minerva.jdbc.xa.XAPo
APoolDataSource.java:165)
MySqlDB] at org.jboss.jdbc.XADataSourceLoader.
der.java:330)
MySqlDB] at org.jboss.util.ServiceMBeanSupport
ava:93)
MySqlDB] at java.lang.reflect.Method.invoke(Na
MySqlDB] at com.sun.management.jmx.MBeanServer
java:1628)
MySqlDB] at com.sun.management.jmx.MBeanServer
java:1523)
MySqlDB] at org.jboss.util.ServiceControl.star
MySqlDB] at java.lang.reflect.Method.invoke(Na
MySqlDB] at com.sun.management.jmx.MBeanServer
java:1628)
MySqlDB] at com.sun.management.jmx.MBeanServer
java:1523)
MySqlDB] at org.jboss.Main.<init>(Main.java:21
MySqlDB] at org.jboss.Main$1.run(Main.java:121
MySqlDB] at java.security.AccessController.doP
MySqlDB] at org.jboss.Main.main(Main.java:117)
I used the following tag in in JBOSS.jacml
<!-- MYSQL -->
<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=MySqlDB">
<attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
<attribute name="PoolName">MySqlDB</attribute>
<attribute name="URL">jdbc:mysql://192.168.0.6/AccountingDb:3333</attribute>
<attribute name="Properties">DatabaseName=AccountingDb</attribute>
<attribute name="JDBCUser"></attribute>
<attribute name="Password"></attribute>
<attribute name="MinSize">0</attribute>
<attribute name="MaxSize">10</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="GCMinIdleTime">1200000</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">true</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
</mbean>
<!-- END MYSQL -->
and JDBC tag is
<!-- JDBC -->
<mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider">
<attribute name="Drivers">org.hsql.jdbcDriver,org.enhydra.instantdb.jdbc.idbDriver,com.pervasive.jdbc.v2.Driver,org.gjt.mm.mysql.Driver</attribute>
</mbean>
plz help me out
thanks
bhuwanI am just use that ...But it works...!!
MySQL is Runing good ...
the problem is that you must reset the defaultDS,
to be Mysql.
So,Jboss must have only one DefaultDS,
In My Setup...
1.standardjaws.xml
<?xml version="1.0" encoding="UTF-8"?>
<jaws>
<datasource>java:/mySQL</datasource>
2.jboss.jcml (must changed as followed)
<!-- JDBC -->
<mbean code="org.jboss.jdbc.JdbcProvider" name="DefaultDomain:service=JdbcProvider">
<attribute name="Drivers">org.gjt.mm.mysql.Driver</attribute>
</mbean>
<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=mySQL">
<attribute name="PoolName">mySQL</attribute>
<attribute name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceImpl</attribute>
<attribute name="Properties"></attribute>
<attribute name="URL">jdbc:mysql://localhost/j2ee</attribute>
<attribute name="GCMinIdleTime">1200000</attribute>
<attribute name="JDBCUser" />
<attribute name="MaxSize">10</attribute>
<attribute name="Password" />
<attribute name="GCEnabled">false</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">true</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
<attribute name="MinSize">0</attribute>
</mbean> -
Connect mysql from with dreamweaver using ruby on rails
hi,
i just finish form my database using mysql front, but i begin
to do the interface uisng dreamweaver i find difficulties to
connect it with the database can someone tell how or tell about a
tutorial that talks about this.
notice: i am using ruby on rails
thanks a lothi,
i just finish form my database using mysql front, but i begin
to do the interface uisng dreamweaver i find difficulties to
connect it with the database can someone tell how or tell about a
tutorial that talks about this.
notice: i am using ruby on rails
thanks a lot -
OpenOffice Base - MySQL with JDBC connection
I was using MySQL with ODBC connection, but cannot do all MySQL queries. In OO Forum says dev version does with JDBC.
http://www.oooforum.org/forum/viewtopic.phtml?t=41301
I am now using OpenOffice dev version. I am a bit lost when asked to install MySQL JDBC Driver Class:
com.mysql.jdbc.Driver
Is the driver a part of jre package or to be installed from somewhere?I downloaded, but don't know where and how to install or use it. Took a look at the documentation, seems it requires only to untar but something has to be pointed. I think its something simple but I am overlooking.
EDIT
This thread tells how to do...
http://www.oooforum.org/forum/viewtopic.phtml?t=33199 -
Dear All,
from couple of days I am trying to connect mysql from my oracle database.
I have studied so many documentations and have created one of my own. I am just struck at one point.
My oracle database is 11gR1 and CentOS 5.1 32-bit is the operating system.
MySQL is on a windows based machine and version is 5.1.
What I can do:
I can connect MySQL from Linux using the command: isql –v bssdata <user> <password> [Connected]
I can tnsping the listener using command: tnsping bssdata [OK]
But after setting up what i did in the documentation below when I try to connect mysql using a DB link. It gives the following error:
select * from bssdata.sta_mis_std_marks@bssdata
Error at Command Line:1 Column:40
Error report:
SQL Error: ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
ORA-02063: preceding line from BSSDATA
28500. 00000 - "connection from ORACLE to a non-Oracle system returned this message:"
*Cause: The cause is explained in the forwarded message.
*Action: See the non-Oracle system's documentation of the forwarded
message.
Please help me get out of this. Thank you very much
Here are the details what i did:
Install required packages
Yum install mysql-connector-odbc
Yum install unixODBC
vi /etc/odbc.ini
[bssdata]
# myodbc3 = MySQL ODBC 3.51 Driver DSN
# [myodbc3]
Driver = /usr/lib/libmyodbc3.so
Description = MySQL ODBC 3.51 Driver DSN
SERVER = 192.168.0.68
PORT = 3306
USER = ******
Password = ******
Database = bssdata
OPTION = 3
SOCKET =
vi /etc/odbcinst.ini
# Example driver definitinions
# Included in the unixODBC package
#[PostgreSQL]
#Description = ODBC for PostgreSQL
#Driver = /usr/lib/libodbcpsql.so
#Setup = /usr/lib/libodbcpsqlS.so
#FileUsage = 1
# Driver from the MyODBC package
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc3.so
Setup = /usr/lib/libodbcmyS.so
FileUsage = 1
Test Connection
isql –v bssdata ****** ******
Editing listener.ora file to add entry
# listener.ora Network Configuration File: /u01/app/oracle/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = blissglb.abc.edu.pk)(PORT = 1521))
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
(PROGRAM = extproc)
(SID_DESC =
(PROGRAM = dg4odbc)
(ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
(SID_NAME = bssdata)
(ENVS=LD_LIBRARY_PATH = /usr/local/lib:/u01/app/oracle/product/11.1.0/db_1/odbc)
Restart listener
Lsnrctl> stop
Lsnrctl> start
Test listener
tnsping bssdata
Editing tnsnames.ora file in network directory of oracle
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
BLISSGLB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = blissglb.abc.pk)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = blissglb.abc.edu.pk)
BSSGLB, BSSGLB.abc.EDU.PK =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.24)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = bssglb.abc.edu.pk)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = IPC)
(KEY = EXTPROC1521)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
bssdata =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.66)(PORT = 1521))
(CONNECT_DATA =
(SID = bssdata)
(HS = OK)
Edit Oracle’s bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_HOME=/u01/app/oracle/product/11.1.0/db_1
export ORACLE_HOME
ORACLE_SID=blissglb
export ORACLE_SID
ORACLE_BASE=/u01/app/oracle
export ORACLE_BASE
LD_LIBRARY_PATH=/usr/local/lib:/u01/app/oracle/product/11.1.0/db_1/lib
export LD_LIBRARY_PATH
ODBCINI=/etc/odbc.ini
export ODBCINI
ODBCSYSINI=/etc
export ODBCSYSINI
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export PATH
unset USERNAME
Configure file db_1/hs/admin/inithsodbc.ora
# This is a sample agent init file that contains the HS parameters that are
# needed for the Database Gateway for ODBC
# HS init parameters
#HS_FDS_CONNECT_INFO = <odbc data_source_name>
#HS_FDS_TRACE_LEVEL = <trace_level>
#HS_FDS_SHAREABLE_NAME = <full path name of odbc driver manager or driver>
HS_FDS_CONNECT_INFO = bssdata
HS_FDS_TRACE_LEVEL = off
HS_FDS_SHAREABLE_NAME = /usr/lib/libmyodbc3.so
# ODBC specific environment variables
#set ODBCINI=<full path name of the odbc initilization file>
set ODBCINI=/etc/odbc.ini
# Environment variables required for the non-Oracle system
set <envvar>=<value>
Create Database Link
Create database link bssdata connect to ****** identified by ******** using ‘bssdata’
Using selection query
Select * from bssdata.sta_mis_std_marks@bssdata {Here comes the error described above}
Regards,
ImranHi ,
i am facing the same issue.
These are my findings at this moment.
By looking at http://www.pythian.com/news/1554/how-to-access-mysql-from-oracle-with-odbc-and-sql/ we can see that :
"Connector ODBC 5.1. The Oracle Gateway for ODBC checks/relies on some features, such as the ODBC descriptor, that are not available in 3.51. You can check the associated documentation and bug 32692 for some details about SQLSetDescRec"
So we have a bug related to SQLSetDescRec missing from the libmyodbc3.so library.
We can check this as follows :
[oracle@log]$ nm -D /usr/lib64/libmyodbc3.so | fgrep SQLMoreResults
0000000000017c70 T SQLMoreResults
[oracle@log]$ nm -D /usr/lib64/libmyodbc3.so | fgrep SQLSetEnvAttr
0000000000016c40 T SQLSetEnvAttr
[oracle@log]$ nm -D /usr/lib64/libmyodbc3.so | fgrep SQLSetDescRec
No output for SQLSetDescRec.
Now i have to see how can i get over this bug.
Regards,
George -
ORA-28500 and ORA-02063 while connecting MySQL from Oracle-
Dear All,
My Database is Oracle 11gR2 Rac of 2 nodes and on Linux 64-Bit operating system.
Version of my MySQL database is 5.5.17 it is on Linux 32-Bit operating system.
I am trying to connect MySQL database from Oracle database using a database link.
These are the step by step process that I am following to achieve my target. All my processes are on one node of Oracle RAC.
1)
Yum install mysql-connector-odbc
Yum install unixODBC
2)
Edit file /etc/odbc.ini
[test]
Driver = /usr/lib64/libmyodbc3.so
Description = MySQL ODBC 3.51 Driver DSN
SERVER = 10.0.0.1
PORT = 3306
USER = test
Password = test
Database = test
OPTION = 3
SOCKET =
3)
Edit file /etc/odbcinst.ini
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib64/libmyodbc3.so
Setup = /usr/lib64/libodbcmyS.so
FileUsage = 1
4) test connection
isql –v test test test
Returns:
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
SQL>
5) Now I edit listener.ora file and add the entry. After entry my listener.ora file is like this:
LISTENER =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER))
(ADDRESS = (PROTOCOL = TCP)(HOST=testnode1)(PORT = 1521))
# line added by Agent
LISTENER_SCAN1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = LISTENER_SCAN1))
# line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1 = ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER = ON # line added by Agent
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
(SID_DESC =
(PROGRAM = dg4odbc)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = test)
(ENVS=LD_LIBRARY_PATH = /usr/local/lib:/u01/app/oracle/product/11.2.0/dbhome_1/lib)
6) After these entries the listener status after RESTART is as following:
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 27-DEC-2011 01:19:32
Uptime 0 days 9 hr. 31 min. 12 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File /u01/app/grid/diag/tnslsnr/racnode1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=testnode1)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "test" has 1 instance(s).
Instance "test", status UNKNOWN, has 1 handler(s) for this service...
Service "testdb" has 1 instance(s).
Instance "testdb1", status READY, has 1 handler(s) for this service...
Service "racdbXDB" has 1 instance(s).
Instance "testdb1", status READY, has 1 handler(s) for this service...
The command completed successfully
7) Then in the tnsnames.ora file I added the following entry:
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = IPC)
(KEY = EXTPROC1521)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
test =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.1)(PORT = 1521))
(CONNECT_DATA =
(SID = test)
(HS = OK)
When i tnsping test, it works.
8) I edit the .bash_profile file for Oracle
ORACLE_HOME, ORACLE_BASE were already pointing to the correct destination, I added:
LD_LIBRARY_PATH=/usr/local/lib:/u01/app/oracle/product/11.1.0/db_1/lib:/u01/app/oracle/product/11.2.0/dbhome_1/hs/lib:/usr/lib64:/usr/lib
export LD_LIBRARY_PATH
ODBCINI=/etc/odbc.ini
export ODBCINI
ODBCINSTINI=/etc/odbc.ini
export ODBCINSTINI
ODBCSYSINI=/etc
export ODBCSYSINI
9) Then i configured $ORACLE_HOME/hs/admin/inithsodbc.ora
And Modified these lines:
HS_FDS_CONNECT_INFO = test
HS_FDS_TRACE_LEVEL = ON
HS_FDS_TRACE_FILE_NAME = odbc_test.log
HS_FDS_TRACE_LEVEL = 4
HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so
HS_FDS_SUPPORT_STATISCTICS = FALSE
HS_LANGUAGE = AMERICAN_AMERICA.WE8ISO8859P1
set ODBCINI = /etc/odbc.ini
10) Then i created a database link with the following command:
Create public database link test connect to test identified by test using ‘test’;
I tried username and password in database link with double quotes also.
11) Now Finally when I try to select records from mysql table:
select count(*) from "table"@"test"; -- I have tried with and without double quotes
I get the following error:
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
ORA-02063: preceding line from TEST
How to get through this error, and how to check logs for HS?
Your help is required.
Regards, Imran
Edited by: misterimran on Dec 27, 2011 1:21 PMHi,
In your listener.ora for the DG4ODBC entry you had -
(ENVS=LD_LIBRARY_PATH = /usr/local/lib:/u01/app/oracle/product/11.2.0/dbhome_1/lib)
but this should also include the path for the driver manager directory which in your case is /usr/lib64 so could you add this ?
The error -
Failed to load ODBC library symbol: /usr/lib64/libmyodbc3.so(SQLSetDescRec)
indicates the /usr/lib64 directory cannot be accessed.
The entry should then look like -
(SID_DESC =
<space>(PROGRAM = dg4odbc)
<space>(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
<space>(SID_NAME = test)
<space>(ENVS=LD_LIBRARY_PATH = /usr/local/lib:/usr/lib64:/u01/app/oracle/product/11.2.0/dbhome_1/lib)
<space>)
The spaces may have bene lost when posting but there should be at least one space in the file as indicated by the <space>.
After making the change then stop and start the listener.
If you still have problems then please post again the current versions of the configuration files, the full errors shown in SQLPLUS for a select and the output from a debug trace showing the errors.
The information shows you are using the 3.51 MySQL ODBC driver so could you also try with the latest version of the 5.1 driver and see if you have the same problem ?
Regards,
Mike -
How to Connect MySQL Database Through JTable?
Hi,
How to Connect MySQL Database Through JTable? anyone of u knows these concept please send me coding of that Part..
Thanks,
Guru..Start by reading the tutorials. There's a section on Swing which shows you how to use tables and a section on JDBC which shows you how to use SQL.
And you can always search the forum as well since there are working examples of both posted on the forum.
If you need further help with a specific problem then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
Don't forget to use the [Code Formatting Tags|http://forum.java.sun.com/help.jspa?sec=formatting], so the posted code retains its original formatting. -
How to connect Mysql to J2EE server exactly?
Hi,there
I would like thank you for offering me your precious opinion in advance.
I got a problem with installing Mysql database into J2EE server. All I have done is:
1.Install Mysql and put the Mysql driver,mm.mysql-2.0.4-bin.jar into the directory of J2EE which is j2ee1.3.1/lib.
2. Set the environment variable for invoking the Mysql driver like
this,CLASSPATH=.;%JAVA_HOME%\lib\mysql-connector-java-2.0.14-bin;%
J2EE_HOME%\lib\mysql-connector-java-2.0.14-bin;%JAVA_HOME%\bin;
3.Modify the content of Server.xml file located in J2EE directory like this:
<DefaultContext>
<Resource name="jdbc/mysql" auth="Container"
type="javax.sql.DataSource" />
<ResourceParams name="jdbc/mysql">
<parameter>
<name>driverClassName</name>
<value>org.gjt.mm.mysql.Driver</value>
</parameter>
<parameter>
<name>drivername</name>
<value>jdbc:mysql:localhost:3306:mobiledb</value>
</parameter>
</ResourceParams>
</DefaultContext>
So far,I have no success in connect Mysql to J2EE server. What am I doing wrong?
Thank you for your kind help.hi, sameer
Thank you for reply. Could you tell me exactly the documents that you see? Do you mean "J2EE tutorial documents"?
Thanks for advice.
Revon -
Hi Im a newbie in J2EE. (just started learning it 2 days back that new..;-)
I managed to set up a simple application using the J2ee tutorial. Now i want to try out a database application. I have a mysql database installed. Can anyone guide me on how to setup mysql with j2ee server? Are there any online tutorials etc that would help me in this?
I actually managed to create a connection pool however when i try to ping it i get an error message with says "An error has occurred. Operation 'pingConnectionPool' failed in 'resources' Config Mbean. Target exception message: Class name is wrong or classpath is not set for : org.gjt.mm.mysql.jdbc2.optional.MysqlDataSource" .
I hav already set classpath of mysql driver. Do i need to copy the jar file to any other directory?
Im not too sure if the way i have created connection pool is right, but i used the defaults specified so i guess that should be ok.
Any Help would be appreciated.
Thanks in advance.Hi! I�m Brazilian and I�ve been learning the English language yet, but I�ll try to describe how to configure J2EE with MySQL.
I am using MySQL version 4.1.7 with J2EE version 1.3 on Windows XP Professional. The driver version of MySQL is 3.0.16.
You have to configure the following two files:
- <J2EE_HOME>\bin\setenv.bat
- <J2EE_HOME>\config\resource.properties
Do the following steps:
1) Copy the JAR file of MySQL driver (mysql-connector-java-3.0.16-ga-bin.jar) to <J2EE_HOME>\lib directory.
2) In <J2EE_HOME>\bin directory open the setenv.bat file and analize the code. It is not hard to understand the code, it is just the classpath configuration of J2EE. After understand it, add a reference of MySQL driver (mysql-connector-java-3.0.16-ga-bin.jar), that was copied to <J2EE_HOME>\lib directory.
3) Run the <J2EE_HOME>\bin\j2eeadmin.bat to configure the resource.properties file.There are two command lines to be executed, as below:
- j2eeadmin.bat -addJdbcDriver <CLASS NAME OF THE DRIVER>
- j2eeadmin.bat -addJdbcDatasource <JNDI NAME> <URL>
For example:
- j2eeadmin.bat -addJdbcDriver "com.mysql.jdbc.Driver"
- j2eeadmin.bat -addJdbcDatasource "jdbc/mysql/test" "jdbc:mysql://localhost/test?user=username&password=pass"
4) After run j2eeadmin.bat, the resource.properties file will be modified. But when I did it and when I executed the verbose command to start J2EE, some error messages was exhibited. So I decided to open the resource.properties file and I noticed hat the character "\" was added erroneously in a lot of places of the code. It did not seem correct, so I decided to remove these characters replacing them. Bingo!!! After I did it, I run verbose again and no more message error ocurred. I think it is a bug of J2EE.
Finish! I modified the datasource JNDI to access MySQL and then I run my EAR application. No problems occurred. My application is running succesfully.
Good luck!
Maybe you are looking for
-
I have two hard drives. One is meant to be a backup drive. The problem is that my catalogue is getting half the pictures from one drive and half from the other. How can I make it get all files from one drive? I am using LR4.
-
Display vendor name in the additional costs details for the PO
Hi, I was wandering if there is any possibility to display vendor's name in the additional costs detail in the conditions tab in PO. As for standard, only the vendor number is shown. Regards.
-
Adding custom fields in Delivery transaction
Hi, I need to add custom fields in the delivery transaction(VL01N/VL02N) at Item level in Material tab screen. Are there any screen exits available for delivery order in any other tabs or Do I have to modify the standard program. Regards, Sudheer
-
Continue playing transisition from state1 to state2 after being in state3.
OK, I don´t know entirely how to explain this, but I´l give it a shot. I am making an animation with a video. The first thing you will see is a playbutton. When you push it the video starts, and you transit from state1 to state2. Since I have downloa
-
Hello, We have a a SLT system [SAP NetWeaver 7.3 with DMIS 2011_1_730 0005 ]. When we try to replicate tables from LTRC transaction, we see that the tables go into Replication[Initial mode] and stay like that. But when i go to proceesing steps tab a