Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc problem

 
sihani rani
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

In mysql

1)i want to create table to store book detail,in this table id is primary key.

2)that id should be in character with integer (ex : ib21 , ir21 , op5 , th65)


then how do i create id column in table...what datatype can i use for id in table creation.



please reply me,
thanks in advance..
 
Prasad Krishnegowda
Ranch Hand
Posts: 670
4
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use varchar...
 
Rahul Nair
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You may create the another column possibly with Long data type which is the primary key for the table and use the existing bookDetailId of data type varchar with Unique Key Constraints which stores the id according to your Char and Integer Concatenation Logic...

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic