• Post Reply Bookmark Topic Watch Topic
  • New Topic

accesing a database  RSS feed

 
abiose ibigbami
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I would like my java server pages to interact with a database. I know this might not be as easy as it may seem. aside using JDBC which of course requires basic knowledge of SQL, I would like to know what other processes are involved in setting this up i.e. changes needed in the deployment desscriptor, JDBC drivers and any other needed information.
thanks
abiose
 
steve souza
Ranch Hand
Posts: 862
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The vendors jdbc driver is required. So is the class name and the database url (For sybase the driver is com.sybase.jdbc2.jdbc.SybDriver and the dbUrl would be something like jdbc:sybase:Tds:127.0.0.1:2638/ASADemoDB. For mySql com.mysql.jdbc.Driver and jdbc:mysql://localhost/databasename?user=root).
Sybase requires you to install server side JDBC scripts/code. I'm not sure if other vendors require this or not. If you are using J2EE DataSources you need to use jndi to access the datasource, and set up the DataSource in the server (i.e. websphere, web logic, tomcat,...). I have a demo war available you can download at http://www.fdsapi.com that has code to connect to Sybase ASE, Sybase ASA, MySQL, and HSQLDB.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!